diff --git a/modules/docs.nix b/modules/docs.nix index 377d35f..3fa7f62 100644 --- a/modules/docs.nix +++ b/modules/docs.nix @@ -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 ''; };