Skip to content

Commit

Permalink
Feat: PWA 내에서 이미지 캐싱
Browse files Browse the repository at this point in the history
  • Loading branch information
soulchicken committed Oct 25, 2023
1 parent ecc811c commit cc7d78d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,19 @@ const config = {

const nextConfig = withPWA({
dest: 'public',
runtimeCaching: [],
runtimeCaching: [
{
urlPattern: /\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'static-image-assets',
expiration: {
maxEntries: 64,
maxAgeSeconds: 24 * 60 * 60, // 24 hours
},
},
},
],
disableDevLogs: true,
})(config);

Expand Down

0 comments on commit cc7d78d

Please sign in to comment.