Caching means keeping a ready-made copy of something so it doesn’t have to be produced again. Websites use several layers.
| Layer | Stores | Where | Speeds up |
|---|---|---|---|
| Page cache | Finished HTML pages | On the server | Server response (TTFB) |
| Object cache | Results of database queries | Server memory | Dynamic pages and admin |
| Opcode cache | Compiled PHP code | Server memory | Every PHP request (handled by the server) |
| Browser cache | Images, CSS, JS | Visitor’s device | Repeat visits and page-to-page |
| CDN cache | Static files, sometimes pages | Locations worldwide | Distant visitors |
The one that matters most
For WordPress and other dynamic sites on shared hosting, a page cache makes the biggest difference: pages served from cache need almost no PHP or database work, so they’re faster and use far fewer resources. Caching WordPress on shared hosting
Browser caching
Tell browsers to keep static files with cache headers. Hosting static sites and JavaScript framework builds includes an example.
The downside: stale content
Caches can show an old version after you change something.
- Clear the page cache in your caching plugin after edits
- Hard-refresh your browser (Ctrl + F5, or Cmd + Shift + R on a Mac)
- Purge Cloudflare’s cache if you use it
Website showing an old version or the previous host
What shouldn’t be cached
Anything personal: logged-in pages, baskets, checkouts, account areas.