From 77a18df25702e7802a3f69b41ad7cbf158b0f152 Mon Sep 17 00:00:00 2001 From: Berwn Date: Thu, 18 Jun 2026 12:19:42 +0700 Subject: [PATCH] Stop browsers serving stale docs by forcing revalidation --- modules/docs.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/docs.nix b/modules/docs.nix index c9ab38d..377d35f 100644 --- a/modules/docs.nix +++ b/modules/docs.nix @@ -30,6 +30,11 @@ 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" file_server ''; };