-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.js
47 lines (46 loc) · 1.4 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
43
44
45
46
47
const withPWA = require("next-pwa");
const defaultCache = require("next-pwa/cache");
module.exports = withPWA({
pwa: {
dest: "public",
runtimeCaching: [
{
// eslint-disable-next-line no-restricted-globals
urlPattern: ({ url }) => self.origin === url.origin && url.pathname.startsWith("/api/source"),
handler: 'CacheFirst',
options: {
cacheName: 'api-source-url',
expiration: {
maxEntries: 32,
maxAgeSeconds: 24 * 60 * 60 // 1 day
}
}
},
{
urlPattern: /^https:\/\/\w+\.googleusercontent\.com\/.*/i,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'youtube-assets',
expiration: {
maxEntries: 64,
maxAgeSeconds: 7 * 24 * 60 * 60 // 7 days
}
}
},
...defaultCache
]
},
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Permissions-Policy",
value: "interest-cohort=()"
}
]
}
]
}
});