fix(cache): disable html caching to prevent stale nuxt chunks
This commit is contained in:
@@ -188,6 +188,20 @@ export default defineNuxtConfig({
|
||||
}
|
||||
}
|
||||
},
|
||||
routeRules: {
|
||||
// Avoid stale HTML after deploys (old page -> missing _nuxt chunks -> white flash).
|
||||
'/**': {
|
||||
headers: {
|
||||
'cache-control': 'no-store'
|
||||
}
|
||||
},
|
||||
// Keep long-lived immutable cache for hashed static assets.
|
||||
'/_nuxt/**': {
|
||||
headers: {
|
||||
'cache-control': 'public, max-age=31536000, immutable'
|
||||
}
|
||||
}
|
||||
},
|
||||
devServer: {
|
||||
host: '0.0.0.0',
|
||||
port: 3000
|
||||
|
||||
Reference in New Issue
Block a user