fix(spa): cacheControl:false so custom cache headers actually apply
@fastify/static's default Cache-Control management overwrote the setHeaders values with 'public, max-age=0' (verified on prod after the v2.4.8 deploy) - the README requires disabling it for custom headers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -206,6 +206,11 @@ async function start() {
|
|||||||
root: path.join(__dirname, "..", "dist-client"),
|
root: path.join(__dirname, "..", "dist-client"),
|
||||||
prefix: "/",
|
prefix: "/",
|
||||||
wildcard: false,
|
wildcard: false,
|
||||||
|
// The plugin's own Cache-Control management must be OFF or it
|
||||||
|
// overwrites the setHeaders values below with "public, max-age=0"
|
||||||
|
// (README: "To provide a custom Cache-Control header, set this option
|
||||||
|
// to false"). ETags stay on, so no-cache still revalidates cheaply.
|
||||||
|
cacheControl: false,
|
||||||
// Deploy-skew caching contract (per the Vite deploy guide):
|
// Deploy-skew caching contract (per the Vite deploy guide):
|
||||||
// - /assets/* names are content-hashed → safe to cache forever
|
// - /assets/* names are content-hashed → safe to cache forever
|
||||||
// (a changed file always gets a NEW name, so "immutable" is correct).
|
// (a changed file always gets a NEW name, so "immutable" is correct).
|
||||||
|
|||||||
Reference in New Issue
Block a user