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

This commit is contained in:
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

View file

@ -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: {