Skip to content

Commit

Permalink
fix: more explicit caching
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Jan 6, 2024
1 parent e1bee81 commit 328b737
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ declare module 'vue-router' {
routeRules[nitroPreset.includes('vercel') ? 'isr' : 'swr'] = config.cacheMaxAgeSeconds
routeRules.cache = {
// handle multi-tenancy
swr: true,
maxAge: config.cacheMaxAgeSeconds,
varies: ['X-Forwarded-Host', 'X-Forwarded-Proto', 'Host'],
}
// use different cache base if configured
Expand Down Expand Up @@ -447,6 +449,7 @@ declare module 'vue-router' {
sitemapName: config.sitemapName,
isMultiSitemap: usingMultiSitemaps,
excludeAppSources: config.excludeAppSources,
cacheMaxAgeSeconds: nuxt.options.dev ? 0 : config.cacheMaxAgeSeconds,

autoLastmod: config.autoLastmod,
defaultSitemapsChunkSize: config.defaultSitemapsChunkSize,
Expand Down

0 comments on commit 328b737

Please sign in to comment.