Long-lived caching makes repeat visits faster, but only when a changed file receives a new URL. Hashed JavaScript and CSS filenames are designed for that model; HTML usually needs a shorter freshness window.
Match the policy to the file
- Fingerprint static assets and serve them with a long max-age plus immutable.
- Let HTML revalidate or expire quickly enough that deployments can update page content.
- Avoid applying a long immutable policy to filenames that are overwritten in place.
Cache-Control: public, max-age=31536000, immutableVerify the response, not the config
After deployment, inspect the headers on both a hashed asset and an HTML page. A configuration file can be ignored, overridden, or cached by an upstream CDN.
Good caching supports performance and reliable releases. It does not change indexing directly, but a fast and stable site is easier for people to use.
