Skip to content

Commit 89e2431

Browse files
authored
perf: replace ISR with CDN cache for versioned code and docs routes (#2297)
1 parent 873562d commit 89e2431

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nuxt.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,12 @@ export default defineNuxtConfig({
167167
'/package/:org/:name/_payload.json': getISRConfig(60, { fallback: 'json' }),
168168
'/package/:org/:name/v/:version/_payload.json': getISRConfig(60, { fallback: 'json' }),
169169
// infinite cache (versioned - doesn't change)
170-
'/package-code/**': { isr: true, cache: { maxAge: 365 * 24 * 60 * 60 } },
171-
'/package-docs/**': { isr: true, cache: { maxAge: 365 * 24 * 60 * 60 } },
170+
'/package-code/**': {
171+
headers: { 'Cache-Control': 'public, s-maxage=31536000, stale-while-revalidate=31536000' },
172+
},
173+
'/package-docs/**': {
174+
headers: { 'Cache-Control': 'public, s-maxage=31536000, stale-while-revalidate=31536000' },
175+
},
172176
// static pages
173177
'/': { prerender: true },
174178
'/200.html': { prerender: true },

0 commit comments

Comments
 (0)