← Notes

Hostinger said my HTML was fine for a week

Lighthouse said my HTML was fresh for a week. It was not. A tiny Hostinger cache fight, told as a spark note.

I shipped this portfolio as a static Next dump to Hostinger - rsync, done, go touch grass. Then Lighthouse casually reported my pages were cacheable for seven days. Cool. Except I had just deployed. And the old JS chunks were still haunting people like a bad sequel.

Two clocks, one lie

Fingerprinted assets (/_next/static) should live forever: hash changes, browsers grab the new file. HTML should be the opposite - check again on every visit so you do not point at yesterday's chunks. I set Cache-Control that way. Hostinger's CDN also slapped on an Expires of plus seven days. Browsers listened to the louder roommate.

The spark fix

In .htaccess: unset Expires on the hashed stuff, keep HTML at max-age=0, must-revalidate. Not no-store - that kills back/forward cache and makes every return trip feel like a cold open. Fresh enough to redeploy safely, warm enough that the back button still feels instant.

Bonus plot twist: Notes come from Sanity at build time. Publish in Studio, then rebuild and ship. Free CMS, static hosting, one ritual. No midnight why-is-prod-serving-last-Tuesday mysteries - unless Expires sneaks back in.