Skip to content
Launch offer 50% off your first year of Keel Pro. See prices →

Redis object cache for WordPress: what it does and when it helps

A page cache saves whole pages; an object cache saves database answers. When Redis makes a real difference, when it does not, and how to switch it on safely.

Keel team · · 2 minutes read

“Use Redis” is common advice for slow WordPress sites. It can help a lot, or do almost nothing, depending on the site. The difference comes down to which pages are slow and why.

Two different caches

  • A page cache saves the finished HTML of a page and serves it to the next visitor. WordPress does not run at all.
  • An object cache saves the answers to database questions while WordPress builds a page. WordPress still runs, but asks the database less.

WordPress has an object cache built in, but by default it only lasts for one request: everything it remembers is forgotten when the page is done. A persistent object cache such as Redis keeps those answers in memory between requests, so the next page can reuse them.

Where it helps

An object cache only matters on pages that WordPress has to build fresh. That means:

  • wp-admin: every screen your team uses.
  • Shops: carts, checkouts and account pages, which cannot be page-cached.
  • Membership sites and forums: logged-in visitors see personal pages.
  • Headless sites: the REST API answers every request from the front end.
  • Sites with many plugins that store their settings and data in the database.

On a brochure site where almost every visitor gets a page-cached page, Redis changes little for visitors. It still makes the editors’ wp-admin faster.

What you need

Redis is a separate program that runs on the server. Many managed and VPS hosts offer it, sometimes with one click in the hosting panel. Cheap shared hosting often does not. Ask your host for:

  • the server address, usually 127.0.0.1, or a socket path such as /var/run/redis/redis.sock;
  • the port, normally 6379;
  • a password, if their Redis requires one.

Switching it on with Keel Pro

In Keel › Caching › Object cache (Redis), enter the server details and switch on Use Redis. Keel only turns it on after a successful connection test, and if Redis ever stops, the site keeps working without it instead of showing an error.

If several sites share one Redis server, give each a different Database number, so they never read each other’s data.

How to tell whether it helped

  1. Before switching it on, time a few wp-admin screens and, on a shop, the cart page. Your browser’s developer tools show the time to the first byte.
  2. Switch Redis on and repeat the same steps a few times, so the cache fills.
  3. Compare. On a shop with many plugins, the difference on uncached pages is often clear. On a small site, it may be small.

Common questions

Can Redis break my site?

Rarely. The usual problem is a plugin that stores data in a way that does not expect a persistent cache, which shows as settings that do not seem to save. Clearing the object cache fixes it, and the plugin’s developer can be told.

Redis or Memcached?

Both do the job. Redis is more common on WordPress hosting today and is what Keel supports.

Do I still need a page cache?

Yes. For pages that are the same for everyone, nothing beats a page cache. Redis is for everything the page cache cannot cover.

Keel does this for you.

Speed, security and SEO in one WordPress plugin, with plain-language settings. Free on any number of sites.

Get Keel free

Five minutes from now

Give your site a keel.

Steady when traffic spikes, calm when attacks come, found when people search. Start free; go Pro when a site needs more.