What Is Website Caching and How Does It Speed Up My Site?
Website caching stores ready copies of pages and files so they load faster. Learn about browser, server and CDN caching, and how to clear cache when needed.

Short answer: Caching means storing a ready-made copy of something, such as a page, image or file, closer to where it's needed so it doesn't have to be fetched or rebuilt every time. Browsers cache files on the visitor's device, CDNs cache copies on servers around the world, and servers cache finished pages so they don't rebuild them for every visitor. Together these layers make a site load dramatically faster, especially on repeat visits and for visitors far from your server.
Caching is one of those invisible technologies that decides whether your site feels instant or sluggish. It's also behind the classic support question: "I changed my website, so why can't I see it?" Let's explain how it really works and how to use it well.
The kitchen analogy
Imagine a busy café. Making each coffee from scratch, grinding beans and steaming milk, takes time. Now imagine the café could keep a few perfect, identical coffees ready on the counter for the regular order everyone wants. Customers get served instantly. That counter is a cache. The trick is knowing what can be prepared in advance, how long it stays fresh and when to throw it away and make a new one.
Websites work the same way, just with files and pages instead of flat whites.
The layers of caching
| Layer | Where it lives | What it stores | Benefit |
|---|---|---|---|
| Browser cache | Visitor's phone or computer | Images, CSS, JavaScript, fonts | Repeat visits and page-to-page navigation load very quickly |
| CDN / edge cache | Servers in many cities worldwide | Pages and files | Visitors get content from nearby, not from one distant server |
| Server page cache | Your web host | Finished HTML pages | Dynamic sites skip rebuilding pages for each visitor |
| Object or database cache | Your web host | Database query results | Dynamic sites run faster under load |
| DNS cache | Devices and networks | Domain to server lookups | Faster connection setup |
How browser caching works
When your server sends a file, it can include a Cache-Control header telling the browser how long to keep it. For example, Cache-Control: max-age=31536000, immutable says "keep this for a year and don't even check for changes". That's ideal for files that never change once published, such as a versioned stylesheet or a photo.
HTML pages usually get a much shorter lifetime, or a setting that makes the browser check with the server before reusing it, because page content changes more often. The browser can then ask "has this changed?" using an ETag or last-modified date, and the server replies with a tiny 304 Not Modified if nothing's new.
The professional trick is cache busting: when a long-cached file changes, give it a new file name, like styles.a83f2c.css. The HTML points to the new name, so browsers fetch it fresh, while unchanged files stay cached. This is how well-built sites get both maximum caching and instant updates.
How CDN and edge caching works
A CDN (content delivery network) keeps copies of your site on servers in dozens or hundreds of locations. When someone in Vancouver visits a site hosted in London, the request goes to a nearby edge server instead. If that server already has the file cached (a "cache hit"), it replies immediately. If not (a "cache miss"), it fetches from the origin, delivers it and keeps a copy for the next visitor.
Distance matters because data takes time to travel, and loading a page needs several round trips. Cutting each one from a long intercontinental hop to a short local one makes a real difference, especially on mobile. Our guide to what a CDN is covers this further.
Static sites shine here: because every page is a finished file, the whole site can be cached at the edge, not just images. Dynamic sites can usually only cache part of their content safely.
How server caching helps dynamic sites
On WordPress and similar platforms, every page view normally runs PHP and database queries. A page cache saves the finished HTML after the first visitor, so the next hundred visitors get the saved copy. An object cache keeps frequent database results in memory. These make a big difference to speed and to how many visitors a modest server can handle. But they add configuration, and they can break things like carts, logged-in views and forms if set up carelessly.
A worked example: a personal trainer in Sydney with UK clients
An illustrative personal trainer runs online coaching for clients in Australia and the UK. The site is on cheap shared hosting in one Australian data centre, with no caching configured. Australian visitors find it acceptable; UK visitors find it painfully slow, because every file travels halfway round the world, and every page is rebuilt from the database each time.
The fix in layers:
- Put the site behind a CDN so UK visitors are served from a European edge location.
- Set long cache lifetimes for images, CSS and JavaScript, with versioned file names.
- Enable page caching (or move to a static build so every page can be cached at the edge).
- Exclude the booking and payment pages from aggressive caching so they always show live availability.
Result: fast loading for both audiences, a lighter load on the server and no stale booking slots. You can see the kind of improvement this makes by running a speed test before and after.
Cached at the edge worldwide, from day one.
SiteDrum sites are static builds served from Cloudflare's global network, with smart caching and instant updates built in. Take a look at our plans.
"Why can't I see my changes?"
Because something is still serving an older cached copy. In order of likelihood:
- Your browser: try a hard refresh (Ctrl+Shift+R on Windows, Cmd+Shift+R on Mac) or a private window.
- The CDN: the edge still holds the old version until it expires or is purged. Purge the cache, or ask your provider to.
- A server or plugin cache: clear it in your hosting or plugin settings.
- Google: search results update when Google next crawls, which is a different thing entirely.
Well-run setups purge relevant caches automatically whenever you publish, so this problem rarely appears.
Mistakes to avoid
- No caching headers at all. Browsers re-download everything on every visit. Speed tools will flag "serve static assets with an efficient cache policy".
- Caching HTML for too long without a purge strategy. Visitors see outdated prices or opening hours.
- Caching personalised pages. On dynamic sites, a cached cart or account page can show one customer's details to another. Exclude anything user-specific.
- Stacking several caching plugins. On WordPress, multiple caching layers fighting each other cause bizarre bugs. Use one, configured properly.
- Changing files without changing names when they're cached for a long time. Visitors keep the old version. Use versioned file names.
- Treating caching as a cure-all. It hides slowness for cached visits, but the first visit, uncached pages and heavy images still matter. Fix the underlying weight too; see why is my website so slow?
Our take
We love caching, but we love not needing complicated caching even more. On a dynamic site, caching is a clever layer of plasters over the fact that pages are rebuilt constantly. On a static site served from the edge, the whole site is effectively a cache: every page is already finished and sitting near your visitors. That's why we build the way we do, and why our sites stay fast without anyone tweaking plugin settings at midnight.
If you run a dynamic platform you're happy with, good caching (one well-configured page cache plus a CDN) can make a real difference, and you may not need to switch at all. Where we'd step in is when caching has become a maze of conflicting plugins and the site is still slow: that's usually a sign the foundations need rethinking.
Quick checklist
- Run a speed test and look for cache policy warnings.
- Set long cache lifetimes for images, CSS, JavaScript and fonts, with versioned file names.
- Keep HTML cache lifetimes short or purge on publish.
- Put your site behind a CDN, especially if your customers are spread out.
- On dynamic sites, use one page cache and exclude carts, accounts and forms.
- Know how to purge your cache, or make sure your provider does it automatically.
The bottom line
Caching stores ready-made copies of your site's files and pages in the browser, on edge servers and on your host, so they load without being fetched or rebuilt from scratch. Set sensible cache rules, use a CDN, purge when you publish and avoid caching anything personal. Do that, and your site feels fast for every visitor, wherever they are.
Frequently asked questions
What does clearing the cache do?
It deletes stored copies so the next request fetches a fresh version. Clearing your browser cache shows you the latest version of sites you visit, while purging a CDN or server cache makes new content visible to all visitors. It doesn't delete anything from your actual website.
Does caching help SEO?
Indirectly, yes. Caching speeds up pages, which supports good Core Web Vitals and a better user experience, both of which matter to Google and to visitors. It also reduces server load so your site stays responsive during busy periods.
Why do I still see the old version of my website after updating it?
A cached copy is still being served, usually by your browser, a CDN or a server cache. Try a hard refresh or a private window first, then purge your CDN or hosting cache. Good setups clear relevant caches automatically when you publish.
Is caching safe for online shops and booking sites?
Yes, when configured carefully. Product images, styles and scripts can be cached heavily, but carts, checkout, account pages and live availability should be excluded or handled specially. Caching personalised pages can show the wrong information to the wrong customer.
What is the difference between a CDN and caching?
Caching is the general idea of storing ready-made copies to reuse. A CDN is a network of servers around the world that caches your content close to visitors. So a CDN is one important type of caching, alongside browser and server caching.
Want a website that brings you customers?
Tell us what you do on WhatsApp and we will send a fixed quote and a free mockup.
Get my free mockupRelated guides
Our products
Website design near you
Website design in LondonWebsite design in New YorkWebsite design in TorontoWebsite design in Los AngelesWebsite design in RotterdamWebsite design in CalgaryWebsite design in LeicesterWebsite design in CanberraWebsite design in LiverpoolWebsite design in AustinAll cities →
SiteDrum home · All guides · Sitemap · Contact us
More tech guides
- How Do I Back Up My Website Properly?
- What Is a Website Builder and Is It Right for My Business?
- Static vs Dynamic Websites: What Is the Difference?
- What Does GDPR Mean for My Small Business Website?
- Do I Need Terms and Conditions on My Website?
- How Do I Add a Contact Form to My Website?
- How Do I Stop Spam on My Website Contact Form?
- Why Does My Website Say Not Secure and How Do I Fix It?