diff --git a/nuxt.config.ts b/nuxt.config.ts index b6daaa2f9..6ea56570c 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -167,8 +167,12 @@ export default defineNuxtConfig({ '/package/:org/:name/_payload.json': getISRConfig(60, { fallback: 'json' }), '/package/:org/:name/v/:version/_payload.json': getISRConfig(60, { fallback: 'json' }), // infinite cache (versioned - doesn't change) - '/package-code/**': { isr: true, cache: { maxAge: 365 * 24 * 60 * 60 } }, - '/package-docs/**': { isr: true, cache: { maxAge: 365 * 24 * 60 * 60 } }, + '/package-code/**': { + headers: { 'Cache-Control': 'public, s-maxage=31536000, stale-while-revalidate=31536000' }, + }, + '/package-docs/**': { + headers: { 'Cache-Control': 'public, s-maxage=31536000, stale-while-revalidate=31536000' }, + }, // static pages '/': { prerender: true }, '/200.html': { prerender: true },