Cookie Consent by Privacy Policies website

How to Set Up and Configure Redis Object Caching for WordPress in Hostinger

Redis is an in-memory data structure store that can be utilized as a caching solution to improve the performance and speed of WordPress websites. When integrated with WordPress, Redis can significantly reduce the time taken to fetch data from the database, leading to faster loading times for your site’s pages.

In this tutorial, we will walk you through the steps to set up and configure Redis object caching for your WordPress website hosted on Hostinger.

Why Use Redis Object Cache?

Redis object caching in WordPress offers numerous benefits that significantly improve the performance and user experience of your website. By storing data in memory, Redis allows quick access to cached information, leading to faster page loading times. This, in turn, reduces the load on the database by caching frequently requested data, making your site more efficient and scalable.

As a result, your WordPress site can handle higher traffic volumes without sacrificing performance. With improved loading speeds, visitors are more likely to stay on your site, resulting in a better user experience. Redis also provides efficient memory usage, allowing you to cache specific data and control how long it is stored. Overall, Redis object caching is a valuable tool for enhancing your WordPress site’s performance and ensuring a smoother user experience.

Steps to Setup Redis Object Cache in WordPress in Hostinger

Prerequisites

  1. A WordPress website hosted on Hostinger (Business or Higher hosting plan).
  2. Enable the object cache feature from the hostinger hPanel (do it from Hosting->WordPress->Overview)
  3. A Redis Cloud account with a free 30 MB database (from Redis Labs).
How to Set Up and Configure Redis Object Caching for WordPress in Hostinger
Hostinger hPanel Settings To Enable Object Cache

By default, this option will immediately enable object cache with the opensource Memcached database method. Which is also fair enough for begineers.

Step 1: Create a Redis Cloud Database

How to Set Up and Configure Redis Object Caching for WordPress in Hostinger
Free Redis Database Subscription
  1. Sign up for a Redis Cloud account by visiting the Redis Cloud website (https://redis.com/try-free) and completing the registration process.
  2. After successful registration, log in to your Redis Cloud account.
  3. Create a new database by selecting a free plan and choosing your desired location. This will generate a 30 MB free database for you to use.

Step 2: Obtain Connection Credentials

How to Set Up and Configure Redis Object Caching for WordPress in Hostinger
Redis Database Host Address
  1. Once your database is created, click on its name to access the database information page.
  2. Note down the public endpoint address provided on this page. This will be your host address.
  3. Scroll down to the Security section and locate the login credentials. The default username will be “default,” and you can copy the default user password.
How to Set Up and Configure Redis Object Caching for WordPress in Hostinger
Redis Database Default Username and Password

Step 3: Install Litespeed Cache Plugin

  1. Log in to your WordPress dashboard.
  2. Navigate to the “Plugins” section and click on “Add New.”
  3. Search for “Litespeed Cache” in the plugin search bar and click “Install Now.”
  4. After the installation is complete, click “Activate” to enable the plugin.

Step 4: Configure Redis Object Caching in Litespeed Cache Plugin

How to Set Up and Configure Redis Object Caching for WordPress in Hostinger
Configuring Litespeed Cache Plugin to Enable Redis Object Cache
  1. In the WordPress dashboard, go to “LiteSpeed Cache” from the left-side menu and click on “Settings.”
  2. Choose the “Object” tab at the top of the settings page.
  3. Under “Object Cache,” select “Redis” as the caching method.
  4. Enter the host address and port number obtained from Step 2 in the corresponding fields.
  5. Provide the username (which is “default”) and paste the default user password.
  6. Click on the “Save Changes” button to apply the settings.

Step 5: Verify Redis Connection

  1. After saving the changes, the page will reload, and you should see all the options in green, especially “Connection test: Passed.” This indicates a successful connection to the Redis database.

Step 6: Monitor Redis Database

  1. To check the size of your Redis database, log in to your Redis Cloud account and navigate to the apps page.
  2. You will be able to see the current database size in Megabytes.

Step 7: Monitor Redis Object Cache

For more comprehensive monitoring of your Redis object cache, you can use the Redis Insight module. Download the Redis Insight Module from the Redis Labs account dashboard.

Install Redis Insight on your computer and add the Redis database with the same host address and login credentials used in the WordPress Litespeed cache plugin.

How to Set Up and Configure Redis Object Caching for WordPress in Hostinger
Redis Insight Module Showing Object Cache Database Memory Consumption

With Redis Insight, you can monitor memory consumption, stored object cache keys, their size, and expiry.

    Conclusion

    By following these steps, you have successfully set up and configured Redis object caching for your WordPress website hosted on Hostinger. Redis caching can significantly boost your website’s performance and improve the overall user experience.

    With Redis Cloud, you can enjoy the benefits of faster page loading times without the need for custom-configured VPS hosting plans. Remember to monitor your Redis database periodically and consider upgrading your plan if your project grows larger, as Redis Cloud offers scalable options to meet your needs. Happy caching!