CDNs and Caching Explained Through One Website Request
A cache stores a response so it can be reused, and a content delivery network can serve material from distributed locations. For a website owner, the key question is which content can be reused safely and how quickly changes should become visible. Start with one request and follow its path.
Why it matters
Caching is a correctness decision as well as a speed decision. A public logo and a signed-in account page have different requirements, even if both appear on the same website.
A practical workflow
- Identify public static assets, frequently changing pages and personalised responses before choosing cache rules.
- Inspect the response headers and understand which layer stores each type of content and for how long.
- Define how an update becomes visible, using versioned asset names or appropriate invalidation for changed content.
- Test as both a signed-in and signed-out user to ensure personal information is never reused for someone else.
An example
A versioned logo file can often be cached for a long time because a new filename accompanies a change. An offer page with an approaching expiry needs a freshness policy that matches how quickly availability can change.
A mistake to avoid
Do not apply one aggressive cache rule to every route. Incorrect cache keys or missing privacy controls can serve stale or personal data to the wrong audience. Clearing a browser cache also does not clear every upstream cache.
Try it and check the result
Change a harmless test asset and a public text page, then inspect how updates appear from a fresh session. Confirm that the observed behaviour matches the policy rather than relying on a single reload.
Reference and further reading
MDN's overview of HTTP requests and responses.
The workflows and examples in this guide are illustrative. Product controls and availability can change; check the linked official guidance for your setup.
Continue with Free Tier vs Free Trial vs Credits: Know What You Are Claiming or explore all blog topics.