perf: set `maxAge` for various public assets (#1916)

zio/stable
Daniel Roe 2023-03-26 16:53:07 +02:00 committed by GitHub
parent a1026d3aab
commit e062fb5e52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

View File

@ -130,6 +130,28 @@ export default defineNuxtConfig({
prerender: {
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,
hooks: {