Resources · 6 min read
Website Caching Strategies: Browser Cache, Server Cache, and CDN Cache Explained
The three layers of caching, browser, server, and CDN, explained: what each stores, how to configure it, and how they work together to speed up a site.
Share

Key takeaways
- Caching stores copies of site files so repeat requests are served faster instead of regenerated from scratch.
- Browser cache saves static assets on the visitor’s device, cutting repeat downloads on later page loads.
- Server cache serves pre-generated pages or cached query results, reducing PHP and database work.
- CDN cache serves content from edge servers near visitors and reduces load on the origin server.
- A strong caching setup uses browser, server, and CDN caching together with the right invalidation rules.
Caching is the practice of storing ready-made copies of your website's files at various points between your server and the visitor's browser, so repeat requests are served from the nearest fast copy instead of being regenerated from scratch. It is one of the highest-impact performance optimizations available, and one most websites still do not configure properly.
Done well, caching makes pages load noticeably faster, eases the load on your server, and improves your Core Web Vitals. The key is understanding that caching is not a single switch. It happens in three layers that work together, and getting real results means configuring each one for your specific type of site rather than turning on a plugin and hoping.
What are the three layers of website caching?
The three layers are browser cache, server cache, and CDN cache, and each stores a different thing in a different place. Browser cache lives on the visitor's device, server cache lives on your origin server, and CDN cache lives on edge servers spread around the world. They are complementary, not alternatives.
| Layer | Where it lives | What it stores | Mainly helps |
|---|---|---|---|
| Browser cache | The visitor's device | Static assets (CSS, JS, images, fonts) | Repeat visits and page-to-page navigation |
| Server cache | Your origin server | Pre-built HTML and database query results | Avoiding repeated PHP and database work |
| CDN cache | Edge servers worldwide | Cacheable content near each visitor | Visitors far from your origin server |
Each layer catches what the layer in front of it missed, which is why a strong setup uses all three rather than picking one.
How does browser caching work?
Browser caching stores files directly on the visitor's device, so after the first visit, CSS, JavaScript, images, and fonts are read from local disk instead of downloaded again. Return visits and navigation between pages then skip those network requests entirely, which is the fastest possible way to serve a resource: not serving it at all.
You control it through HTTP headers, mainly Cache-Control and Expires. The right duration depends on how often a file changes:
- Static assets that rarely change (images, fonts, CSS or JS with versioned filenames): set a long duration like
Cache-Control: max-age=31536000, one year. - Assets that change occasionally: use a shorter duration with validation, such as
Cache-Control: max-age=3600, must-revalidate, one hour, then check. - HTML documents: use
Cache-Control: no-cacheor a short duration so visitors always see current content.
The versioned-filename trick is what makes the one-year duration safe: when a file changes, its name changes, so the browser fetches the new one instead of serving a stale copy forever.
Why does server caching matter, especially for WordPress?
Server caching stores pre-generated page output so the server does not have to run code and query the database for every single request. On a WordPress site this is the difference between assembling each page from scratch on every load (slow) and serving a pre-built HTML file from disk or memory (fast).
Page caching plugins such as WP Rocket, W3 Total Cache, and LiteSpeed Cache handle this for WordPress. For custom applications, reverse-proxy caches like Varnish or Nginx FastCGI cache do the same job, while Redis or Memcached provide object caching that keeps database query results in memory so repeated queries return instantly. The result is the same across all of them: dramatically less work per request, which means faster responses and more headroom on the same hardware. Getting this right is where performance optimization becomes strategy rather than just "cache everything."

What does cache invalidation mean?
Cache invalidation is deciding when a cached copy should be thrown away and refreshed, and it is the genuinely hard part of caching. Cache too aggressively and visitors see stale content; cache too little and you lose the performance benefit. The right answer depends entirely on how dynamic the content is.
A blog can invalidate its cache when new content is published, since most pages are static between posts. An e-commerce site with live inventory is different: product pages may need shorter cache durations or event-based invalidation that refreshes a page the moment stock changes, so customers never see "in stock" on something that just sold out. There is no universal setting, which is exactly why a thoughtful caching policy beats a generic plugin default.
How does CDN caching fit in?
A CDN adds a global caching layer that serves content from the edge server nearest each visitor, so someone far from your origin is not waiting on a round trip across the world. When it is configured well, the CDN answers most requests itself, and your origin server only has to respond when the CDN's cache needs refreshing.
That matters most for sites with geographically spread traffic. Instead of every visitor reaching back to one server in one location, they hit a nearby edge node, which cuts latency and takes a large share of load off the origin. The CDN sits in front of everything else, so it is the first layer that gets a chance to answer a request before it ever reaches your server.
How do the three layers work together?
The three layers work together by each handling a different slice of traffic, so very little reaches the origin server. The CDN answers the first request from a given region, the browser cache handles that visitor's repeat visits and page navigation, and the server cache handles the requests that miss the CDN and reach the origin.
In practice that means a visitor's first load is served quickly from a nearby CDN edge or generated once by the server, their subsequent pages come largely from browser and CDN cache, and their return visits are nearly instant because most assets are already on their device. Without any caching, that same site regenerates everything on every request and feels sluggish by comparison. The improvement is real and measurable, and it feeds directly into user experience, SEO, and conversions, which is why caching is one of the first things worth configuring on any launch.

If you want your site's caching set up properly across all three layers rather than left on plugin defaults, book a call and we will configure it for how your site actually works.
Related service
Web design services in the PhilippinesFrequently asked questions
What are the three main layers of website caching?
The article identifies browser cache, server cache, and CDN cache. Browser cache stores files on the visitor’s device, server cache stores pre-generated output or query results, and CDN cache stores content on edge servers near visitors.
How should browser caching be configured for static assets?
For static assets that rarely change, such as images, fonts, and versioned CSS or JavaScript, the article recommends long cache durations like Cache-Control: max-age=31536000. Assets that change occasionally should use shorter durations with validation.
Why does server caching matter for WordPress sites?
Server caching prevents WordPress from querying the database and assembling HTML from scratch on every page load. Page caching plugins can serve pre-built HTML from disk or memory instead, which is faster.
What does cache invalidation mean?
Cache invalidation is deciding when cached pages should be refreshed. A blog might refresh cache when new content is published, while an e-commerce site may need shorter durations or event-based invalidation when stock changes.
How do browser cache, server cache, and CDN cache work together?
The article says the CDN handles requests from each region, browser cache speeds up repeat visits and page navigation, and server cache handles misses at the CDN level. Together, they improve load times and reduce server work.
Slow site costing
you customers?
We build fast, conversion-focused sites. Let's see where yours is losing people.
Get in touchPillar guideDevelopment · Feb 26
Core Web Vitals Optimization: A Practical Guide to Google’s Page Speed Benchmarks
Resources · Apr 15
Monitoring Website Uptime: Tools and Strategies to Prevent Revenue-Killing Outages
Resources · Apr 5
CDN Explained: How Content Delivery Networks Speed Up Your Website Globally
Business · Mar 30