Redis is an in-memory data store used for object caching, session storage and queues.
Redis is a very fast database that keeps its data in memory (RAM) rather than on disk. Websites use it as a short-term store for data they need again and again, such as the results of common database queries, logged-in sessions or a list of jobs waiting to be processed.
A typical example: a WooCommerce shop with Redis connected as its object cache. Product details, settings and menus that would normally need dozens of MySQL queries per page are read from Redis instead, in well under a millisecond each.
How Redis works
Redis stores data as keys and values. Your application saves something under a key, like product:42:price, and can read it back almost instantly. Unlike simpler caches, Redis understands several data types:
- Strings for single values
- Hashes for objects with fields
- Lists and sets for ordered or unique collections
- Sorted sets for leaderboards and rankings
- Streams for event logs and queues
Every key can have an expiry time, after which Redis removes it automatically. When memory runs low, Redis can evict older keys based on a policy you choose. It can also save its data to disk, so a restart doesn't always mean an empty cache.
Why Redis matters for your website
Database queries are often the slowest part of building a dynamic page. Answering them from memory reduces database load and improves server response time, especially on pages a page cache can't help with, like carts, checkouts, account areas and the WordPress admin.
Common uses on websites include:
- Object caching for WordPress, Drupal, Magento and similar platforms
- Session storage, so logged-in users stay logged in quickly and reliably
- Queues for background jobs in frameworks like Laravel
- Rate limiting and counters
Redis vs Memcached
Memcached is the other well-known in-memory cache. It's simpler and stores plain strings only. Redis adds more data types, optional persistence and features like replication. For a standard website object cache, either works, but Redis is the more common choice today because one service covers caching, sessions and queues.
How to use Redis with WordPress
You need a Redis server available on your hosting and a plugin or drop-in that connects WordPress to it, such as Redis Object Cache or the object cache option in LiteSpeed Cache. On AblePage, Redis object caching is available on every plan. Once enabled, check the plugin's status page to confirm it's connected, then watch your hit rate.
Common Redis problems
- Stale content after editing data directly in the database. Flushing the cache fixes it.
- Not enough memory, so useful keys are evicted too soon.
- Two plugins both trying to install an object cache drop-in.