From 3b962fe3ca9803336e1fa7928ba7fe298289b09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Sat, 29 Aug 2026 22:32:33 +0100 Subject: [PATCH] the typefaces get a year, the build output does not MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Everything sat at seven days, which Lighthouse counts as short for a file that never changes. /fonts/ now gets a year and `immutable`. A typeface is not edited — it is replaced, and a replacement arrives under a new name. It is the one directory here where a long life cannot pin something stale. Everything else stays at a week deliberately. Those names are stable across builds and the HTML that references them revalidates every time, so a longer life means somebody running last week's stylesheet against this week's markup. Fingerprinted filenames are what would earn a year, and the build does not write them. Co-Authored-By: Claude Opus 5 (1M context) --- api/static-site.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/api/static-site.ts b/api/static-site.ts index 5873f46..ea00d6b 100644 --- a/api/static-site.ts +++ b/api/static-site.ts @@ -235,7 +235,18 @@ const NGINX_CONF = `server { add_header Cache-Control "public"; } - location ~* \\.(css|js|woff2|webp|png|jpg|jpeg|gif|svg|ico|mp4)$ { + # The typefaces. A year, because a face is not edited — it is replaced, and a replacement is a new + # name. This is the one directory here where a long life carries no risk of pinning something stale. + location ^~ /fonts/ { + expires 1y; + add_header Cache-Control "public, immutable"; + } + + # Everything a build produces. Seven days and no more: these names are stable across builds and the + # HTML that references them is revalidated every time, so a longer life means a visitor running last + # week's stylesheet against this week's markup. Fingerprinted filenames are what would earn a year + # here, and the build does not write them. + location ~* \\.(css|js|webp|png|jpg|jpeg|gif|svg|ico|mp4)$ { expires 7d; add_header Cache-Control "public"; }