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