Back to Hosting FAQs
HELP CENTER · FAQHosting2 min read

How should I cache static assets on my hosted site?

A useful asset cache policy balances fast repeat visits with reliable updates when a release changes files. Give versioned assets long-lived cache headers, keep the HTML entry point easier to revalidate, and make deployment publish the new references and files consistently.

Hosting

Version files that change

Use content fingerprints or explicit release versions in asset URLs. A browser or edge cache can then safely keep an old immutable file because a new deployment points to a different URL when its contents change.

Apply long freshness periods only to files whose URL changes when the content changes. If an image, script, or stylesheet is overwritten at the same URL, clients may continue to use a stale copy until its cache expires.

Keep navigation current

Set HTML and other small entry documents to revalidate or use a short freshness window so users discover the current release. Confirm that the hosting layer forwards appropriate cache headers and does not cache personalized pages as public assets.

After deployment, verify both a first request and a repeat request, then check that the new HTML refers to available asset versions. Plan how to purge or roll back when an incorrect release is published.

Back to Hosting FAQs