---
title: "What is the object cache in WordPress? | WP Ministry"
url: https://wpministry.co/glossary/object-cache/
description: "WordPress's object cache keeps database data so it is not fetched twice. A persistent one keeps it between requests, for pages a page cache cannot hold."
lang: en-US
---

Skip to content

# Object cache

WordPress's object cache keeps data it has read from the database, so the same data is not fetched twice. By default it lasts for one request. A persistent object cache keeps it between requests, which speeds up the pages a page cache cannot hold.

By

WP Ministry

Published

October 8, 2026

## In short

- Every WordPress site has an object cache. What most sites lack is a persistent one, which keeps the data from one request to the next.
- A persistent object cache usually needs a cache server from your host, such as Redis or Memcached, and a plugin that connects WordPress to it.
- It helps the dashboard, logged-in users and a store's checkout, which a page cache cannot serve.

While it builds one page, WordPress needs the same data many times: the site's settings, a post, a user. The object cache keeps each piece in memory under a name once it has been read, so asking again costs no trip to the database.

Two things go by this name. The one built into WordPress is, in the words of its reference, "non-persistent": the data stays in memory "only for the duration of the request" and is thrown away when the page is sent. A persistent object cache keeps the data between requests in a cache server such as Redis or Memcached, which WordPress's guide says the hosting provider has to offer. When someone says a site has an object cache, they mean a persistent one.

It is not a page cache (https://wpministry.co/glossary/page-cache/), which stores finished pages and skips WordPress altogether. The object cache works inside WordPress while a page is being built. A transient (https://wpministry.co/glossary/transient/) is a single stored value with an expiry time, and it moves into the object cache when a persistent one is in place. OPcache (https://wpministry.co/glossary/opcache/) stores compiled PHP code, not data. A CDN (https://wpministry.co/glossary/cdn/) stores files outside your server.

## Where you meet it

- **Site Health.** Go to Tools, then Site Health. On a live site the Status tab shows one of three lines: "You should use a persistent object cache", "A persistent object cache is not required" or "A persistent object cache is being used". Under the first it adds "Your hosting provider can tell you if a persistent object cache can be enabled on your site."
- **A file in `wp-content`.** A persistent cache works through a file named `object-cache.php`, placed there by the plugin that connects WordPress to the cache server. Under Site Health, then Info, the "Drop-ins" section lists it as "External object cache." WordPress's documentation says it is separate from a page cache's file and can work without the `WP_CACHE` line in `wp-config.php`.

## How to look at yours

bash

```
wp cache type
```

`Default` means the built-in cache only. Any other answer, such as `Redis`, names a persistent one. WP-CLI's reference notes that this is a guess made from the file's code.

## What goes wrong

- **A busy site has none.** Every dashboard screen, cart and checkout reads the same settings from the database again. See how to find the cause of a slow WordPress admin (https://wpministry.co/blog/slow-wordpress-admin/), why the WooCommerce dashboard is slow (https://wpministry.co/blog/woocommerce-slow-admin/) and how to reduce server response time (https://wpministry.co/blog/reduce-wordpress-server-response-time-ttfb/).
- **A change made straight to the database goes unseen.** With a persistent cache, WordPress does not go back to the database for what it already holds. After an import, a search and replace, or an edit to a row, it can keep using the old value until the cache is emptied with `wp cache flush`. How to deactivate plugins when you are locked out (https://wpministry.co/blog/deactivate-wordpress-plugins-locked-out/) and how to move WordPress to a new domain (https://wpministry.co/blog/move-wordpress-to-new-domain/) both meet this.

## Common questions

Does every WordPress site need a persistent object cache?

No. Site Health recommends one only when the site holds enough data to gain from it, and says "A persistent object cache is not required" otherwise. WordPress's hosting handbook says it is particularly helpful where pages are hard to cache, such as for logged-in visitors and stores.

Is Redis the object cache?

Redis and Memcached are cache servers: programs that hold data in memory. The object cache is WordPress's own. A plugin's `object-cache.php` file makes WordPress keep its object cache in that server.

Is it safe to flush the object cache?

Yes. It holds copies of data that WordPress can fetch again. The site does more work until the cache refills, and WP-CLI warns of that cost on a live site. On a multisite network a flush typically empties the cache of every site.

## Not sure what is wrong?

Tell us what you see. We reply with the cause and a fixed quote, and the diagnosis is free.

Get a free diagnosis: https://wpministry.co/free-diagnosis/

May we measure how this site is used?

A yes notes the pages of this visit and loads Google Analytics. A no keeps and loads nothing. See the cookies page (https://wpministry.co/legal/cookies/).

If you say yes, we note the pages you look at during this visit and load Google Analytics. If you say no, nothing is kept and nothing is loaded. The site works the same either way. The cookies page (https://wpministry.co/legal/cookies/) has the details.

## Structured data

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Organization",
      "@id": "https://wpministry.co/#organization",
      "name": "WP Ministry",
      "url": "https://wpministry.co/",
      "logo": "https://wpministry.co/brand/logo.png",
      "address": {
        "@type": "PostalAddress",
        "streetAddress": "1309 Coffeen Ave STE 1200",
        "addressLocality": "Sheridan",
        "addressRegion": "WY",
        "postalCode": "82801",
        "addressCountry": "US"
      },
      "sameAs": [
        "https://www.linkedin.com/company/wp-ministry/",
        "https://x.com/wpministryco",
        "https://www.instagram.com/wpministryco/",
        "https://www.facebook.com/wpministryco",
        "https://www.tiktok.com/@wpministryco",
        "https://www.pinterest.com/wpministryco/",
        "https://www.youtube.com/channel/UCOZRuAukk5QSTRPG6BaHl3Q"
      ]
    },
    {
      "@type": "WebSite",
      "@id": "https://wpministry.co/#website",
      "name": "WP Ministry",
      "url": "https://wpministry.co/",
      "inLanguage": "en-US",
      "publisher": {
        "@id": "https://wpministry.co/#organization"
      }
    },
    {
      "@type": "DefinedTerm",
      "@id": "https://wpministry.co/glossary/object-cache/#term",
      "name": "Object cache",
      "description": "WordPress's object cache keeps database data so it is not fetched twice. A persistent one keeps it between requests, for pages a page cache cannot hold.",
      "url": "https://wpministry.co/glossary/object-cache/",
      "inDefinedTermSet": "https://wpministry.co/glossary/"
    },
    {
      "@type": "BreadcrumbList",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
          "name": "Home",
          "item": "https://wpministry.co/"
        },
        {
          "@type": "ListItem",
          "position": 2,
          "name": "Glossary",
          "item": "https://wpministry.co/glossary/"
        },
        {
          "@type": "ListItem",
          "position": 3,
          "name": "Object cache"
        }
      ]
    }
  ]
}
```