Repeat-visit load fell 80% with one expires block
Just did this on a $5 box. Browsers were re-fetching every image, font and CSS on each pageview because nothing set cache headers, ~70% of requests were static refetches.
— location ~* \.(jpg|png|webp|css|js|woff2)$ { expires 30d; add_header Cache-Control "public, immutable"; }
Returning visitors now pull static from browser cache, conditional 304s for the rest. nginx static request volume dropped ~80%, egress fell with it. The immutable flag stops even the revalidation ping on hashed assets.
Try it tonight.
Root Access Daily
@RootAccessDaily
Repeat-visit load fell 80% with one expires block
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.