The customer portal my.neoserv.com has been redesigned. If you notice any issues, please let us know.

Cart (0)
  • Your cart is currently empty.

NEOSERV BLOG

Tips, guides and useful information about domains, hosting, SSL certificates, email, web optimization and online security.

Category: Websites
Published:

Looking for ways to speed up your WordPress website? You’re definitely not the only one. Every website owner is trying to optimise the speed of their website and improve the user experience. One of the best ways to achieve this goal is to use Redis.

Redis(REmote DIctionary Server) is a high-performance key :value database that is an extremely fast in-memory data server capable of handling high-level data types. As this is virtually impossible or extremely difficult to achieve in most databases today, this gives Redis a unique advantage that can significantly improve performance.

Using Redis for server-side object caching can greatly improve WordPress page load times. Redis is also used on many popular web platforms such as GitHub, Pinterest, Stack Overflow and others.

Find out what Redis is and how you can use it to speed up your WordPress website below.

Sitemap

What is Redis and how is it used in WordPress?

Redis is an open source in-memory database server – a NoSQL database, also called a data structure server. The reason for this is that its basic data types are similar to those of programming languages. These include strings, hashes, data sets and other types of data.

It also features various tools, such as geospatial data types, such as coordinates, which allow efficient development of applications that require working with these data types. It also features a probabilistic data structure that greatly speeds up the calculation of certain approximations of values for large amounts of data, which speeds up computational operations in applications where an approximation, rather than an exact result, is sufficient (the standard deviation is “only” about 0.18%). Its wide range of tools makes Redis an excellent choice of database for modern and fast application development: Rapid Application Development (RAD).

Redis na Turbo paketih

In fact, Redis is most often used in conjunction with WordPress in the area of caching, more specifically object caching, and it is this that can make Redis significantly speed up the performance of your WordPress website. Let’s take a look at what caching is and how it works.

Redis and object caching

Object caching means that the results of the most common data server (MariaDB/MySQL) queries are stored in memory. When subsequent requests for the same information are made, the results are available much faster as they are loaded directly from the Redis server and not from the data server. This reduces the load on the database and enables a faster response of the web application.

Redis cannot replace caching altogether as it is “only” a mechanism for caching objects, not for caching all elements of an application or web page. Redis is therefore not a replacement for existing caching plugins, but an addition to existing caching solutions.

Redis is a modern, by far the fastest object caching solution, which is increasingly used on the WordPress platform. But before we dive into why Redis is so effective at caching objects, let’s learn the basics of “traditional” caching.

Traditional caching

The primary purpose of caching is to make a web page load faster, which is achieved by caching data that visitors access frequently.

When a visitor accesses a web page, the application or web page must connect to the database and request the necessary information to display the page. A request is therefore made to the database to access this information.

The more visitors there are, the more queries are made to the database, which means that visitors have to wait to receive information when traffic increases. This is why a website becomes slow or even stops working when a large number of visitors want to access it at the same time (e.g. when sending out a newsletter).

Caching solves this problem by storing the data that is most likely to be accessed by the majority of visitors. For example, most visitors will first visit the home page of a website, so this page will most likely already be cached.

If a web page is cached, page elements (images, styles, content, etc.) are only loaded on the first visit and then cached. The system remembers what has been loaded, creates a static version and displays it faster the next time the page loads. The result is lower page load times and reduced resource usage on the server hosting the website.

Even though a particular page of a website is already cached, this does not mean that the caching does not perform database queries. The only difference is that the data can be accessed more quickly, but the website may still slow down when the number of visits increases dramatically. The good news is that Redis has fixed this problem completely.

Redis – the solution for caching WordPress objects

Redis is an in-memory database, which means that the data it uses is stored in the RAM memory of the server. In fact, writing to and reading from the cache is faster than writing to and reading from a disk drive (SSD or NVMe). This completely eliminates the queries performed on the database, thus significantly speeding up the performance of the website.

Several studies have shown that a website using Redis for object caching loads between 10% and 30% faster – provided that there is enough space in the cache to store all the data.

This is where the problem arises, because the amount of data that Redis can process is limited. In reality, this is not as big a problem as it first seems, as a normal blog has no problem using Redis caching in most cases. In fact, Redis is aware of this problem and has built-in ways to mitigate it.

The main way to mitigate the problem is the expiration and deletion policy. Each piece of data can be given a so-called Time To Live (TTL), which can range from a few seconds to several days. Once this time has elapsed, the data is removed.

This system helps to keep the amount of data stored to a minimum, making it impossible for a website to exceed the Redis limit (except in situations with extremely high traffic). For these reasons, Redis is considered to be the best caching solution currently available for WordPress.

If your WordPress website is static and only requires a style file (style.css) and a few images to be loaded, you won’t notice a significant difference using object caching. Conversely, a dynamic site can load a huge amount of data that is stored in the database, e.g. user details, taxonomies, links and so on. Using Redis, all this data is cached and ready to be displayed on the page in no time. Page load times are thus much lower and the use of server resources is significantly more efficient.

Frequently asked questions related to Redis

Below we’ve compiled some of the most frequently asked questions about Redis and WordPress, and provided answers to them.

1. When does it make sense to use Redis with WordPress / WooCommerce?

Using Redis technology makes the most sense when you want to optimise a web application or a website that has a high number of users. With a small or medium number of users, Redis will not come into its own as much. It is only with a large number of visitors that bottlenecks start to appear, and the most common performance bottleneck is mass queries to the data server. This is exactly the bottleneck that Redis solves or addresses.

2. Can Redis work with other databases?

Redis is not limited to working in combination with MySQL. A popular choice in the WordPress community is the MariaDB database, with which Redis – as a caching solution – also works perfectly. In most cases, there is nothing to stop you from using Redis with another database. The only limiting factor is whether the web hosting supports Redis and the database you want to use.

3. Is using Redis in a WordPress environment beginner friendly?

Setting up caching using Redis is extremely easy in WordPress, as there are several WordPress plugins that allow communication between the two systems. In most cases, only a basic initial setup is needed and then everything is done automatically. However, Redis offers the possibility of certain adjustments and changes to achieve more efficient caching, and this is where it starts to become a little less user-friendly.

This problem is actually due to a lack of online resources, as Redis is not yet fully established and, unlike MySQL, there are not unlimited guides online with tips and tricks for using it. Given the growing popularity of Redis, this is likely to change soon.

4. Is Redis a good choice for online shops?

Any online shop that is slow to load is at risk of losing visitors. The fact is that Redis can significantly speed up an online shop and thus reduce the likelihood of customers leaving. At the same time, faster loading speeds increase the likelihood of an online purchase.

Online stores typically have many dynamic elements and caching is an invaluable tool to make these work effectively. Recently viewed products, location-based recommendations, stock updates and much more can be cached. This way, visitors can see the most relevant products faster than ever before.

5. Can Redis be used for other purposes?

Redis is also used for non-caching processes, but this is usually not relevant in the context of WordPress.

One of the key benefits of Redis is the use of Pub/Sub functionality, making it a great solution for real-time applications and live streaming events. It is also suitable for leaderboards in games, as it can quickly update the data when a player reaches a new score.

Some users use Redis in machine learning, geospatial data (e.g. GPS travel time), real-time analysis and more. Most of these features are therefore used outside WordPress, but this may change as Redis becomes a more popular solution.

Speed up WordPress sites using Redis

You can speed up your WordPress site in a variety of ways. One of the ones that makes the biggest difference to loading speed, and you’re sure to find it on any list, is using a caching solution. Many web professionals would agree that for WordPress websites, Redis is the best solution in this area.

Redis na Turbo paketih

Using Redis, you can improve the responsiveness of your website and thus have a positive impact on the user experience. Just as importantly, it can also improve your SEO rankings, as speed is an important factor that Google takes into account when ranking search results.

At NEOSERV, we advise the use of Redis caching for owners of large and high-traffic online stores and portals, as well as for owners of more complex web applications. If you are using WordPress, Turbo hosting subscribers can set up object caching using a plugin (e.g. LiteSpeed Cache for WordPress, W3 Total Cache, Redis Object Cache).

Not using Redis yet? Test its performance today – opt for lightning-fast Turbo Hosting and see for yourself how much faster your WordPress website will run after setting up Redis. The add-on is available free of charge and you can find instructions on how to use it here.

COMMENTS

COMMENT THE POST

(mandatory)
(mandatory, email address will be hidden)
(optional)
Security question that confirms you are a real person.