Users expect fast loading times and smooth performance – regardless of whether it’s a company website, online shop or blog. Object caching is a proven method for noticeably improving the loading times and efficiency of your website. But what exactly is behind it? What advantages and disadvantages does it offer? And what exactly is Redis Cache? Especially in contrast to Varnish Cache? You can find out all this and how we integrated WordPress Redis into Raidboxes hosting in this blog post.
What is object caching?
Object caching stores the results of database queries. The aim behind this is to be able to serve future queries more quickly and avoid repeated database accesses. Object caching plays an important role in content management systems such as WordPress, which rely on databases.
Applications ask databases for information (e.g. “What is the price of product X?”). Without caching, the database has to search and return the result each time, which takes time. With caching, the result of the first query is saved (e.g. in the working memory). The next time, the answer can be taken directly from the cache – much faster than going back to the database.
Who benefits from object caching?
Object caching is particularly advantageous for:
- Websites with high traffic due to many simultaneous visitors
- Dynamic websites such as e-commerce platforms or social networks that frequently perform database queries
- Complex WordPress multisite networks
What are the advantages of object caching?
- Improved loading times: By saving database query results, pages can be loaded faster as fewer direct database accesses are required. On the other hand, the data can now be retrieved from the working memory – and this is almost always faster than regular hard disc memory.
- Reduced server load: Fewer database queries lead to lower server utilisation, which is particularly advantageous with high traffic.
- Scalability: Object caching makes it possible to handle more data traffic without having to significantly expand the server infrastructure.
What are the disadvantages of object caching?
- Outdated data: There is a risk that users will see outdated content if the cache is not updated regularly.
- Difficulty: The implementation and management of object caching can bring additional complexity, especially when configuring and deleting already cached/stored data.
- Memory consumption: Saving cache data requires additional RAM, which can be problematic if resources are limited.
What is Redis Cache?
A popular solution for object caching is Redis. Redis(Remote Dictionary Server) is an open source in-memory database. Data is not stored on the hard drive, but in the main memory (RAM). Because Redis stores data in RAM, websites or apps can access information much faster – without having to query the database every time. Redis Cache therefore makes websites extremely fast and can help to significantly speed up large websites and applications (ideal for distributed systems).
What are the differences between Redis and Memcached?
Both Redis and Memcached are in-memory caching systems. This means that the data is stored directly in the RAM instead of on a hard drive or in a database. However, there are the following differences.
Redis | Memcached | |
Data structures | Redis is more flexible and supports various complex data structures Redis Strings offer binary-safe key-value pairs up to 512 MB for any data. Redis lists are ordered sequences with constant insertion and deletion time at the ends. Redis hashes organise field-value pairs compactly under a key. (e.g. [“user_123”: {name: “Max”, age: “30”, city: “Münster”}]). Redis sets summarise unique elements in unordered collections, including set operations such as intersections and unions | Memcached is simpler and only stores simple key-value pairs – a kind of digital notebook in which each entry consists of a name (key) and a content (value) (e.g. key: “User_123”, value: “Max Mustermann”). |
Persistence | Redis offers options for data persistence so that data is retained even after a restart. | Memcached only stores data in RAM and does not support built-in persistence. Conversely, this means: If the server crashes or is restarted, all data from the RAM is lost. |
Scalability | Redis can be scaled both vertically and horizontally. This means that more RAM or a more powerful CPU can be added (vertically) plus data can be distributed across several servers (horizontally). | Memcached is optimised for horizontal scaling. This means that it can be easily distributed across several servers to store more data and work faster. |
What are the differences between Varnish Cache vs Redis Cache?
Redis | Varnish | |
Field of application | Redis is a general-purpose in-memory data store. It can store frequently used data such as database queries, user sessions or application data in memory and retrieve it at lightning speed. For example, an online shop stores in Redis which products users have recently viewed, which filters have been set or the contents of the shopping basket so that they can be displayed immediately the next time they visit the site and do not cause a new database call. | Varnish is an HTTP accelerator (reverse proxy cache). It caches complete web pages and API responses so that the web server does not have to regenerate the content each time a page is requested. For example: A news website uses Varnish to cache static articles (content that is the same for all website users). This means that the same content does not have to be loaded from the server again and again, which reduces the loading time enormously. |
Functionality | Redis stores database queries, sessions and complex data structures directly in the working memory. | Varnish stores complete web pages or API responses in the working memory and delivers them directly without burdening the origin server. It works like an “upstream memory” between the user and the web server (reverse proxy). |
Field of application | Apps, databases, real-time applications | Website caching, API acceleration |
Typical use case | User logins, product recommendations, fast API calls | Website acceleration, relief from CMS systems such as WordPress |
Reduces load for | Database server | Web server |
Persistence on restart | Yes (can save data permanently) | No (cache is cleared after restart) |
Example | A login page saves a person’s session information in Redis so that they do not have to be re-authenticated for every action. | A corporate website like ours uses Varnish to deliver already generated content pages from the cache. If thousands of visitors access the site at the same time, the server does not have to regenerate the page each time. |
Subscribe to the Raidboxes newsletter!
We share the latest WordPress insights, business tips, and more with you once a month.
"*" indicates required fields
The problems: Standard object caching with WordPress
WordPress comes with its own object caching function to speed up recurring database queries. However, WP Redis caching is not persistent, which means:
- Cache data is lost with every completed page request: As soon as a page is requested again, WordPress has to retrieve a lot of data from the database again.
- Potential impairment of website performance: A lot of data marked as “autoloaded” by plugins in the wp_options table can lead to errors such as 502 Bad Gateway if memory limits (e.g. 1 MB) are exceeded in object caching and impair website performance.
- Scaling problems with growing websites: Especially for larger websites with many visitors, the lack of persistent caching means that performance suffers.
Our solution: How your website benefits from Redi’s cache at Raidboxes
To sustainably improve object caching in WordPress, we have developed a special WordPress Redis add-on called Dynamic+ for our customers. This integrates WP Redis caching seamlessly into your website and caches frequent database queries directly in memory.
With Dynamic+ you benefit from the following advantages:
- Persistent caching: Cache data is retained over several page views, reducing repeated database queries.
- Lightning-fast loading times: Especially for dynamic content such as product pages, shopping baskets and personalised user areas.
- Relief for the database & server: Fewer requests to the database ensure stable performance, even with high traffic.
- Better scalability: Your website remains fast and reliable even with increasing visitor volumes.
- Faster search results & shopping baskets: Relevant content is loaded without delay.
- More conversions & fewer bounces: A fast shop means more satisfied customers and higher sales figures.
The upgrade to WordPress Redis with Dynamic+ is perfect for:
- WooCommerce Shops
- Community or membership pages
- Learning platforms
- Websites that have a lot of traffic
How can I book Dynamic+?
If you would like to upgrade an existing Starter or Pro Box to Dynamic+ for even better performance, simply contact us directly via the support chat – we will then take care of the rest. For new boxes, you can book Dynamic+ regularly via the checkout. The Dynamic+ add-on is initially only available for Starter and Pro tariffs.
Conclusion: Maximum performance with WordPress Redis Cache at Raidboxes
Fast loading times are crucial for the success of your WordPress website – regardless of whether you run an online shop, a community or a company website. Standard object caching in WordPress is often not enough to efficiently handle high visitor numbers and dynamic content.
With Dynamic+, we offer a customised solution that seamlessly integrates Redis Cache into your website. This reduces database queries, optimises loading times and reduces the load on your server. The result: better scalability, greater stability and a first-class user experience – even with high traffic.
Activate Dynamic+ with just a few clicks in your dashboard and benefit from a lightning-fast, high-performance website!
Leave a Reply