ZeroToWP

Caching

Quick Definition

Caching stores copies of your website data in a faster location so pages load quicker. WordPress uses three types: page cache (full HTML pages), object cache (database queries), and browser cache (static files on visitors' devices).

WP Rocket — one of the most popular WordPress caching plugins

What Is Caching?

Caching is the process of storing copies of data in a faster location so future requests can be served quicker. According to web.dev, "fetching resources over the network is both slow and expensive" — caching avoids unnecessary network requests by reusing stored responses.

In WordPress, caching is critical because every page request normally requires PHP to execute code, query the MySQL database, apply the theme, and generate HTML. Without caching, this happens on every single page view. With caching, the generated HTML is stored and served directly — skipping all that processing.

WordPress uses three main types of caching:

  • Page cache — stores the entire generated HTML page. When a visitor requests a page, the server returns the cached HTML instead of regenerating it from PHP and MySQL. This is the biggest speed win.
  • Object cache — stores database query results in fast memory (Redis or Memcached). According to the WordPress developer handbook, object caching "moves data from a place of expensive and slow retrieval to a place of cheap and fast retrieval." By default, WordPress's object cache is non-persistent (memory only, per-request).
  • Browser cache — stores static files (images, CSS, JavaScript) on the visitor's device. Controlled by HTTP Cache-Control headers. Reduces server load because returning visitors don't need to re-download files that haven't changed.

Caching in Practice

The easiest way to add caching to WordPress is with a caching plugin:

  • WP Rocket — premium ($59/yr), easiest setup, handles page + browser caching
  • LiteSpeed Cache — free, excellent on LiteSpeed servers, handles all cache types
  • WP Super Cache — free, by Automattic, simple page caching
  • W3 Total Cache — free, powerful but complex, handles page + object + browser + CDN caching

Many hosting providers (SiteGround, Kinsta, Cloudways) include server-level caching that works automatically — you may not even need a caching plugin.

Common gotcha: After making changes to your site (editing a post, updating CSS), you may need to clear the cache to see changes. Most caching plugins add a "Clear Cache" button to your admin toolbar.

Why It Matters

Caching is the single most impactful speed optimization for WordPress. A properly cached site can be 2-10x faster than an uncached one. Faster sites rank higher in Google and keep visitors longer. See our caching plugins comparison and speed optimization guide to get started.

Related Terms

Related Articles