C

Caching

Performance 5 min read Entry 7 of 78
Definition

Caching is keeping a ready made copy of your page so the server can hand it over immediately instead of building it again for every visitor.

In plain English

Without caching, every visit sets off the same work: WordPress wakes up, asks the database for the content, runs the theme and the plugins, and assembles the page. Then it throws the result away and does it again for the next person.

With caching, the first visitor triggers that work once and the finished page is saved. Everyone after them gets the saved copy, which is why a cached site feels instant.

Why it matters

It is usually the single biggest speed win available to a WordPress site, and it costs nothing but a plugin and ten minutes.

It also protects you. When a video goes out and a few thousand people arrive at once, a cached page barely notices. An uncached one can take the server down.

How it works

  1. A visitor asks for a pageThe cache is checked first, before WordPress does anything.
  2. A copy is storedIf there is no copy yet, the page is built once and the finished HTML is written to disk or to memory.
  3. Everyone else gets the copyDelivered straight from storage, skipping the database and the plugins entirely.
  4. The copy expiresAfter a set time, or the moment you publish an edit, so nobody is served yesterday’s page.

Clear the cache before you panic

Nine out of ten times a change that will not show up is a cached page, not a broken one. Clear the cache, hard refresh, and only then start looking for the real problem.