In this guide we will guide you how to enable redis cache for WordPress.What is Redis?
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.
In summary, Redis cache will make your site load faster and normally less than 1 second.How to enable redis cache for WordPress
There are 2 parts:
1/ How to enable PHP Redis cache in cPanel?
- Firstly, you have to enable PHP redis to allow PHP speak and interactive with Redis cache
- Secondly, enable redis under WordPress admin.
2/ How to enable redis under WordPress admin
- Login to your cPanel control panel
- Search for PHP selector
- Navigate to Extensions and tick on Redis
- In this part we will use LiteSpeed cache plugin to enable object cache for WordPress. LiteSpeed cache (called lscache) is the fastest plugin for WordPress today.
- To enable lscache plugin, please follow this guide: how to enable LiteSpeed Cache for WordPress
- Then navigate to Settings -> LiteSpeed Cache -> Object and configure setting parameter as below
- Object Cache: on
- Method: Redis
- Host: 127.0.0.1
- Port: 3344
- Hit save
If Connection Test show Passed
mean you have configure redis for WordPress successful.