Make changes in the layer that owns the response, then verify what reaches the browser. These guides focus on practical decisions rather than universal copy-and-paste policies.
Before you change a header
Identify whether the application, web server, hosting platform, proxy, or CDN sets it. Keep a rollback copy and test representative pages, redirects, and errors. Header changes can affect login, checkout, embeds, and cached responses.
CDN & Proxy Caching
Browser and shared-cache lifetimes can differ. A CDN can also apply its own cache eligibility, cache key, and override rules. Check private, no-store, s-maxage, and Vary together with the provider's settings. Never assume a cookie alone keeps personalized pages out of a shared cache.
Read the shared-cache guide · Cloudflare behavior
Practical guides
Deploy a Content Security Policy
Build a policy around the resources your pages actually use, then test it before switching on enforcement.
Configure HTTPS and HSTS
Reliable HTTPS comes first. A long-lived browser policy should be the result of a working deployment, not the first experiment.
Choose Caching by Response Type
Give different responses different policies. Static assets, public HTML, and private account data do not share the same caching requirements.
Configure CORS and Cookies
Start with the browser flow you want to permit. Keep cross-origin reading, authentication, and cookie delivery as separate decisions.