From f26a8746425215b728ea56a1f8540f707c280132 Mon Sep 17 00:00:00 2001 From: "Zack M. Davis" Date: Sat, 25 Jul 2026 15:55:15 -0700 Subject: [PATCH] don't cache Markdown alternatives --- provisioning/conf.d/common_expires_map.conf | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/provisioning/conf.d/common_expires_map.conf b/provisioning/conf.d/common_expires_map.conf index de18dc8..327f82c 100644 --- a/provisioning/conf.d/common_expires_map.conf +++ b/provisioning/conf.d/common_expires_map.conf @@ -5,10 +5,20 @@ # rebuildable; only one of those copies is the one actually `include`d on a # given server. # -# Forces HTML responses to always revalidate (since a post's URL stays the -# same across edits/redeploys, so a cached page could otherwise go stale -# silently) while leaving normal caching behavior for everything else. +# Forces HTML and Markdown responses to always revalidate (since a post's URL +# stays the same across edits/redeploys, so a cached copy could otherwise go +# stale silently) while leaving normal caching behavior for everything else. +# The .md mirrors are the same posts at equally stable URLs, and they fare +# worse than HTML when cached: a stale entry pins the response headers too, and +# a .md has no to fall back on, so a browser holding an old +# entry keeps rendering it in the wrong encoding until the entry is replaced. +# +# The keys are exact matches even though these responses go out as +# "text/html; charset=utf-8" -- nginx evaluates this map before the charset +# filter appends the parameter. Verified against the live site; no need to +# "fix" these into regexes. map $sent_http_content_type $expires { default off; text/html epoch; + text/markdown epoch; } -- 2.53.0