fix: cache-bust static asset URLs (?v=2)
Browsers cached the pre-fix 404 responses for /static/js/markdown.js and /static/css/markdown.css (responses carry Cache-Control max-age=14400), so users kept seeing broken pages after redeploy. A versioned query string forces clients to refetch the assets; bump ?v= whenever the static files change.
This commit is contained in:
@@ -111,13 +111,16 @@
|
||||
{{define "markdown_assets"}}
|
||||
{{/* Markdown rendering assets: marked (pinned UMD build), DOMPurify,
|
||||
highlight.js and the shared renderer + styles. Include on any page that
|
||||
renders Markdown (articles, comments, editor previews). */}}
|
||||
renders Markdown (articles, comments, editor previews).
|
||||
Local static files carry a ?v= cache-buster: bump it whenever
|
||||
static/js/markdown.js or static/css/markdown.css changes, otherwise
|
||||
browsers may keep serving stale cached copies. */}}
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.12.0/build/styles/github.min.css">
|
||||
<link rel="stylesheet" href="/static/css/markdown.css">
|
||||
<link rel="stylesheet" href="/static/css/markdown.css?v=2">
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked@15.0.12/marked.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/dompurify@3.4.13/dist/purify.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.12.0/build/highlight.min.js"></script>
|
||||
<script src="/static/js/markdown.js"></script>
|
||||
<script src="/static/js/markdown.js?v=2"></script>
|
||||
{{end}}
|
||||
|
||||
{{define "footer"}}
|
||||
|
||||
Reference in New Issue
Block a user