Stop browsers serving stale docs by forcing revalidation

This commit is contained in:
Berwn
2026-06-18 12:19:42 +07:00
parent a4fe2a7b3a
commit 77a18df257
+5
View File
@@ -30,6 +30,11 @@ 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
# 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"
file_server file_server
''; '';
}; };