the typefaces get a year, the build output does not
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) <noreply@anthropic.com>
This commit is contained in:
+12
-1
@@ -235,7 +235,18 @@ const NGINX_CONF = `server {
|
|||||||
add_header Cache-Control "public";
|
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;
|
expires 7d;
|
||||||
add_header Cache-Control "public";
|
add_header Cache-Control "public";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user