]> zackmdavis.net Git - An_Algorithmic_Lucidity.git/commitdiff
don't cache Markdown alternatives
authorZack M. Davis <code@zackmdavis.net>
Sat, 25 Jul 2026 22:55:15 +0000 (15:55 -0700)
committerZack M. Davis <code@zackmdavis.net>
Sat, 25 Jul 2026 22:55:15 +0000 (15:55 -0700)
provisioning/conf.d/common_expires_map.conf

index de18dc88f310de27da59297b37f0a6011cfd738f..327f82c539c5a4fa6526b626df218e5868d4a1cb 100644 (file)
@@ -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 <meta charset> 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;
 }