Compare commits

..

No commits in common. "e842d25b31486485b8fe0e7400917309bdd09db7" and "12a9fe48ff33c501cf3198f0cf33e060993698e3" have entirely different histories.

View File

@ -30,16 +30,14 @@ function noStore(req, res, next) {
} }
// Static-asset options: // Static-asset options:
// - 60s maxAge + ETag on JS/CSS/icons. Long enough that rapid in-session // - 1h maxAge + ETag on JS/CSS/icons so repeated nav skips a network
// clicks skip the network round-trip, short enough that a deploy is // round-trip per file. ~25 script tags × ~5ms RTT each adds up otherwise.
// visible within a minute. Originally tried 1h but that caused stale // - HTML files get Cache-Control: no-cache (still uses ETag, so revalidation
// cached JS to reference things the new HTML no longer loaded (the // is cheap, but new deploys land immediately without waiting for cache
// Phase-B lazy-load refactor changed who loads which script). // expiry — the SPA shell is the file most likely to change between deploys).
// - HTML files get Cache-Control: no-cache (always revalidates via ETag,
// so new deploys land immediately — the SPA shell changes most often).
// - dotfiles='ignore' so .auth.json is never served. // - dotfiles='ignore' so .auth.json is never served.
const staticOptions = { const staticOptions = {
maxAge: '60s', maxAge: '1h',
etag: true, etag: true,
dotfiles: 'ignore', dotfiles: 'ignore',
setHeaders: (res, filePath) => { setHeaders: (res, filePath) => {