Use no-store for docs: epoch mtimes make revalidation serve stale
This commit is contained in:
+6
-5
@@ -30,11 +30,12 @@ in
|
||||
enable = true;
|
||||
virtualHosts.":${toString port}".extraConfig = ''
|
||||
root * ${site}
|
||||
# mdBook doesn't fingerprint asset filenames, so a browser left to its own
|
||||
# heuristics caches the HTML and serves stale docs after a redeploy. Force a
|
||||
# conditional request on every load; file_server's ETag/Last-Modified makes
|
||||
# the unchanged case a cheap 304 over the mesh.
|
||||
header Cache-Control "no-cache"
|
||||
# mdBook doesn't fingerprint asset filenames, and every file in the Nix
|
||||
# store carries an epoch (1970) mtime, so file_server's only validator never
|
||||
# changes across redeploys — conditional requests would 304 forever and pin
|
||||
# browsers to stale docs. no-store sidesteps caching entirely; pages are tiny
|
||||
# and mesh-only, so refetching on each load is free.
|
||||
header Cache-Control "no-store"
|
||||
file_server
|
||||
'';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user