forked from Mirrors/elk
perf: set maxAge
for various public assets (#1916)
This commit is contained in:
parent
a1026d3aab
commit
e062fb5e52
1 changed files with 22 additions and 0 deletions
|
@ -130,6 +130,28 @@ export default defineNuxtConfig({
|
||||||
prerender: {
|
prerender: {
|
||||||
crawlLinks: true,
|
crawlLinks: true,
|
||||||
},
|
},
|
||||||
|
publicAssets: [
|
||||||
|
{
|
||||||
|
dir: '~/public/avatars',
|
||||||
|
maxAge: 24 * 60 * 60 * 30, // 30 days
|
||||||
|
baseURL: '/avatars',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dir: '~/public/emojis',
|
||||||
|
maxAge: 24 * 60 * 60 * 15, // 15 days, matching service worker
|
||||||
|
baseURL: '/emojis',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dir: '~/public/fonts',
|
||||||
|
maxAge: 24 * 60 * 60 * 365, // 1 year (versioned)
|
||||||
|
baseURL: '/fonts',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dir: '~/public/shiki',
|
||||||
|
maxAge: 24 * 60 * 60 * 365, // 1 year, matching service worker
|
||||||
|
baseURL: '/shiki',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
sourcemap: isDevelopment,
|
sourcemap: isDevelopment,
|
||||||
hooks: {
|
hooks: {
|
||||||
|
|
Loading…
Reference in a new issue