This commit is contained in:
parent
593bdb17d4
commit
faf881fa0c
10 changed files with 201 additions and 8 deletions
|
|
@ -80,8 +80,18 @@ catcrafts.net {
|
|||
Cross-Origin-Resource-Policy "same-origin"
|
||||
}
|
||||
# Subresources an isolated document pulls in must carry CORP themselves.
|
||||
# The icons need it for the same reason the stylesheet does: "/" boots the
|
||||
# wasm, so its icon fetches happen inside a require-corp document.
|
||||
#
|
||||
# -precomposed is listed here even though the rewrite below folds it onto
|
||||
# apple-touch-icon.png: Caddy's directive order runs `header` BEFORE
|
||||
# `rewrite`, so this matcher sees the URI as it arrived. (`handle` runs after,
|
||||
# which is why @static does NOT need to list it.) Drop the path here and the
|
||||
# probe still 200s, just bare.
|
||||
header /styles.css Cross-Origin-Resource-Policy "same-origin"
|
||||
header /favicon.svg Cross-Origin-Resource-Policy "same-origin"
|
||||
@icons path /favicon.svg /favicon.ico /apple-touch-icon.png \
|
||||
/apple-touch-icon-precomposed.png
|
||||
header @icons Cross-Origin-Resource-Policy "same-origin"
|
||||
|
||||
# ── analytics, two tiers ──────────────────────────────────────────────
|
||||
#
|
||||
|
|
@ -120,9 +130,23 @@ catcrafts.net {
|
|||
# better than the backend would. `precompressed` serves the .zst / .gz
|
||||
# siblings the CI build produces, so the ~800 KB module is never recompressed
|
||||
# per request. Cache-busted by the ?v=<buildId> in index.html.
|
||||
#
|
||||
# CAVEAT for the icons in here: nothing cache-busts them. Clients ask for
|
||||
# /favicon.svg, /favicon.ico and /apple-touch-icon.png by bare path, so an
|
||||
# immutable year is exactly how long a redrawn icon takes to reach a repeat
|
||||
# visitor. Long-standing for favicon.svg; the rasters inherit it deliberately
|
||||
# rather than diverge. Shorten all three together if that ever bites.
|
||||
#
|
||||
# The rewrite is Safari's legacy Home Screen probe, from before it honoured
|
||||
# <link rel="apple-touch-icon">. What it asks for is byte-identical to
|
||||
# apple-touch-icon.png, so it is folded onto that rather than committed twice
|
||||
# — a second copy would also ride in the wasm bundle's VFS and be fetched at
|
||||
# every boot for nothing. @static below matches the rewritten path.
|
||||
rewrite /apple-touch-icon-precomposed.png /apple-touch-icon.png
|
||||
@static path /catcrafts*.wasm /runtime.js /dom-env.js /dom-webgpu.js \
|
||||
/catcrafts-head.js /files.json /variants.json /styles.css \
|
||||
/favicon.svg /robots.txt /*.wgsl /*.jpg /posts.json /rates.json
|
||||
/favicon.svg /favicon.ico /apple-touch-icon.png \
|
||||
/robots.txt /*.wgsl /*.jpg /posts.json /rates.json
|
||||
handle @static {
|
||||
header Cache-Control "public, max-age=31536000, immutable"
|
||||
file_server {
|
||||
|
|
|
|||
Loading…
Reference in a new issue