-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
42 lines (40 loc) · 1.04 KB
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
output: 'standalone',
images: {
dangerouslyAllowSVG: true,
remotePatterns: [
{
protocol: 'https',
hostname: 'lh3.googleusercontent.com',
},
],
},
};
const withPWA = require('next-pwa')({
dest: 'public',
runtimeCaching: [
{
urlPattern: /\/queue$/,
handler: 'NetworkOnly', // don't cache queue requests, always fetch from network
},
{
urlPattern: /\/ratings$/,
handler: 'NetworkOnly', // don't cache queue requests, always fetch from network
},
{
urlPattern: /^https?.*/,
handler: 'StaleWhileRevalidate', // always cache first, but go to network (if available) for new data and update cache
method: 'GET', // only cache GET requests
options: {
cacheName: 'http-cache',
expiration: {
maxEntries: 200,
maxAgeSeconds: 14 * 24 * 60 * 60, // 14 days
},
},
},
],
});
module.exports = withPWA(nextConfig);