Browser caching, server-side caching, and CDN caching improve website speed at different points in the delivery process. The right approach depends on whether your site is static, dynamic, or an online store.
Table of Contents
How the three caching layers work
Browser caching
Browser caching keeps copies of website resources in a visitor’s browser. When the visitor returns, the browser may reuse those local copies instead of requesting the same resources again. This can make repeat visits faster.
Browser caching is most useful for resources that do not change often, such as files used across many pages. It mainly benefits the same visitor. It does not make the first visit faster in the same way, and it does not reduce the work required to deliver a page to every new visitor.
Server-side caching
Server-side caching stores prepared website data on the hosting server. The server can then reuse that data instead of rebuilding the same response for every request. This reduces repeated processing and can improve loading speed for dynamic websites.
For WordPress, LiteSpeed Cache is a performance optimisation plugin that works together with server-level caching. If WordPress was installed automatically from the mybox panel, LiteSpeed Cache may already be available or ready for configuration. See the LiteSpeed Cache overview for WordPress for the product-specific context.
Server-side caching is useful when a site generates pages dynamically. It can also be useful when many visitors request the same page, because the server can reuse a cached result rather than repeat the same work.
CDN caching
A CDN, or Content Delivery Network, is a distributed network of servers that delivers website content to users more efficiently. Instead of serving all content from one server, a CDN stores copies of selected website resources on servers in multiple geographic regions. Read the mybox definition of a CDN for more background.
CDN caching is most useful when visitors are located in different regions or when a site serves many static resources. A visitor can receive a cached resource from a suitable CDN location instead of requesting every resource from the hosting server.
Which caching layer helps in each situation?
| Website situation | Most useful layer | Reason |
|---|---|---|
| Static website | Browser caching and CDN caching | Static resources can be reused by returning visitors and delivered from distributed locations. |
| Dynamic website | Server-side caching, often combined with browser and CDN caching | The server can reuse prepared responses while static resources are delivered efficiently. |
| Online store | Carefully separated caching layers | Public content can be cached, while private shopper interactions need to remain current. |
Speed, setup, cost, and freshness
Speed impact: Browser caching can provide the quickest repeat access for one visitor because the resource is already local. Server-side caching reduces repeated work on the hosting server. CDN caching can reduce the distance between a visitor and selected website resources.
Setup complexity: Browser caching is controlled through the website’s cache rules and the visitor’s browser. Server-side caching depends on the hosting environment and, for WordPress, may involve LiteSpeed Cache. CDN caching adds another delivery layer and requires clear rules for which resources may be stored.
Cost: Browser caching is part of the visitor’s browsing process. Server-side caching uses the hosting environment. CDN caching uses a distributed delivery service. The practical cost comparison depends on the services included with the chosen hosting setup and CDN arrangement.
Cache invalidation: Invalidation means removing or refreshing an old cached copy after content changes. Each layer can hold a different copy, so a visible update may depend on the browser, server-side cache, and CDN cache all receiving the new version. A caching plan should define which content may remain cached and how changed content is refreshed.
How online stores need a different caching approach
Online stores contain both public content and private shopper interactions. Product or other public resources may benefit from CDN delivery, while cart, checkout, account, and session-related content must remain connected to the current shopper session.
The mybox guidance for WooCommerce on a CDN describes this balance as serving static-grade performance for guests while protecting private interactions for shoppers. This means a CDN should not be treated as a reason to cache every response. The cache rules must separate content that is safe to reuse from content that depends on the shopper.
Choosing one layer or combining layers
- Choose browser caching as a basic layer when the main goal is faster repeat visits for returning visitors.
- Add server-side caching when a dynamic site or WordPress installation repeatedly generates the same page data.
- Add CDN caching when visitors are spread across regions or the site serves many selected static resources.
- Combine the layers when the site needs both efficient server processing and fast delivery of static resources.
- Use stricter cache rules for an online store so public content can be delivered efficiently without caching private shopper interactions.
What to expect after changing caching
A cache change does not always appear in every browser or location at the same time. A visitor may still receive an older cached copy while another visitor receives the updated resource. CDN propagation typically takes a few hours, although it can take longer depending on the domain registrar and network conditions. This is expected behaviour for distributed delivery.
The safest choice is not always the layer with the broadest reach. Use browser caching for repeat visitors, server-side caching for repeated server work, and CDN caching for selected resources delivered across geographic locations. Combining them can improve speed, but the cache rules must match the difference between public content and private, changing data.