Stop browsers serving stale docs by forcing revalidation
This commit is contained in:
@@ -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
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user