What is caching? Page, browser, object and CDN caching explained

The different layers of website caching, what each speeds up, and which ones matter most for a site on shared hosting.

Guide2 min readLast updated
On this page
  1. The one that matters most
  2. Browser caching
  3. The downside: stale content
  4. What shouldn’t be cached
  5. Common questions

Caching means keeping a ready-made copy of something so it doesn’t have to be produced again. Websites use several layers.

LayerStoresWhereSpeeds up
Page cacheFinished HTML pagesOn the serverServer response (TTFB)
Object cacheResults of database queriesServer memoryDynamic pages and admin
Opcode cacheCompiled PHP codeServer memoryEvery PHP request (handled by the server)
Browser cacheImages, CSS, JSVisitor’s deviceRepeat visits and page-to-page
CDN cacheStatic files, sometimes pagesLocations worldwideDistant 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.

Prefer to follow along?

Common questions

Does NVMe storage actually make a difference?

Yes, for database-driven sites. NVMe drives read and write far faster than older mechanical or SATA storage, which shows up most when a page makes many small database queries — exactly what WordPress does on every uncached visit.

This is a general web-hosting explanation, not specific to Traxio.

It is not a substitute for caching. Fast storage makes each query quicker; caching avoids running the queries at all, which is a bigger win.

What’s the difference between page caching and object caching?

Page caching stores the finished HTML so a visit skips PHP and the database entirely. Object caching stores individual database results so repeated queries are faster. Page caching gives most sites the bigger win, and they work well together.

This is a general web-hosting explanation, not specific to Traxio.

What is caching?

Caching saves a ready-made copy of a page so the server doesn’t have to rebuild it for every visitor. It is usually the single biggest speed improvement available to a database-driven site like WordPress.

This is a general web-hosting explanation, not specific to Traxio.

Spotted something out of date or unclear? Tell us and we’ll fix it.

Keep going