{"id":11052,"date":"2023-06-13T14:34:30","date_gmt":"2023-06-13T13:34:30","guid":{"rendered":"https:\/\/www.20i.com\/blog\/?p=11052"},"modified":"2026-01-08T09:17:31","modified_gmt":"2026-01-08T09:17:31","slug":"redis-object-caching-wordpress","status":"publish","type":"post","link":"https:\/\/www.20i.com\/blog\/redis-object-caching-wordpress\/","title":{"rendered":"What Is Redis Object Caching? (And How To Use It for Your WordPress Site)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">We all know the importance of fast-loading web pages. Google loves them and  so do your visitors\/customers. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you run an agency or business\/ecommerce site, it&#8217;s likely you&#8217;re always looking for ways to make your website(s) the absolute fastest on the market. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Redis object caching may be just what you need to succeed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you implement this form of server-side caching, you\u2019ll be able to store database query results to deliver content as quickly as possible. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Plus, setting up object caching is simple when you choose <a href=\"https:\/\/www.20i.com\/wordpress-hosting\">a quality web host like 20i<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this post, we\u2019ll take a closer look at how object caching works. We\u2019ll also delve in to the benefits of implementing it on your site. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, we\u2019ll show you how to install and use Redis object caching in WordPress.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Is Caching?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In a nutshell, caching is temporarily storing data so it can be accessed more quickly at a future date. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You might already be familiar with browser caching (also known as client-side caching):<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1268\" height=\"1176\" src=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/06\/clear-browsing-data-screenshot.png\" alt=\"clear cache data in browser\" class=\"wp-image-11055\" srcset=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/06\/clear-browsing-data-screenshot.png 1268w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/clear-browsing-data-screenshot-300x278.png.webp 300w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/clear-browsing-data-screenshot-768x712.png.webp 768w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/clear-browsing-data-screenshot-400x371.png.webp 400w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/clear-browsing-data-screenshot-800x742.png.webp 800w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/clear-browsing-data-screenshot-832x772.png.webp 832w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/clear-browsing-data-screenshot-1248x1157.png.webp 1248w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/clear-browsing-data-screenshot-150x139.png.webp 150w\" sizes=\"auto, (max-width: 1268px) 100vw, 1268px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">When your browser cache is enabled, it saves a copy of each website\u2019s files when you first visit it. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then, when you revisit that site, its content will be delivered faster. That\u2019s because much of the content can be retrieved from your static browser cache, instead of being re-downloaded.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What Is Object Caching?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In contrast, object caching is a type of <em>server-side<\/em> caching. This means it\u2019s performed on the website\u2019s server, not the user\u2019s browser.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With object caching, the results of database queries are saved on the server itself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This way, the server can deliver similar data requests from the cache.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Is Caching Important for Your WordPress Site?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you know a bit more about caching, you might be wondering why it\u2019s important for your WordPress site. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are a few main reasons.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, when you use object caching, you can reduce your Time to First Byte (TTFB) and <a href=\"https:\/\/www.20i.com\/blog\/website-speed-testing\/\">speed up loading times<\/a>. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This way, you can deliver a smoother user experience. When your visitors are happy, they\u2019ll be more likely to stay on your site and keep coming back.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Additionally, object caching can be great for your server\u2019s health. That\u2019s because it reduces the server\u2019s workload. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of processing the same requests over and over, the server can just pull data from its cache to serve up content to repeat visitors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Memcached vs Redis: What\u2019s the Difference?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to implement object caching to improve your site\u2019s performance, you\u2019ll need to decide <em>how<\/em> you\u2019re going to do it. Memcached and Redis are two of the most popular solutions:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"946\" src=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/06\/screenshot-of-redis-homepage.png\" alt=\"redis website\" class=\"wp-image-11054\" srcset=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/06\/screenshot-of-redis-homepage.png 1600w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/screenshot-of-redis-homepage-300x177.png.webp 300w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/screenshot-of-redis-homepage-768x454.png.webp 768w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/screenshot-of-redis-homepage-1536x908.png.webp 1536w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/screenshot-of-redis-homepage-400x237.png.webp 400w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/screenshot-of-redis-homepage-800x473.png.webp 800w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/screenshot-of-redis-homepage-832x492.png.webp 832w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/screenshot-of-redis-homepage-1248x738.png.webp 1248w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/screenshot-of-redis-homepage-150x89.png.webp 150w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Both are open-source, in-memory data stores. However, Memcached is designed for simplicity, and doesn\u2019t support some of the advanced data structures that you\u2019ll find in Redis.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For instance, Redis can also function as a primary database and message broker. It can even be used for session storage.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What\u2019s more, Redis makes it easier to scale. If your site becomes too big for the open-source version, you can upgrade to Redis Enterprise.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use Redis Object Caching in WordPress&nbsp;<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you know a little about Redis object caching, we\u2019re going to show you how to implement it in WordPress. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The process can be a little complicated, and it may vary depending on your hosting provider.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2139\ufe0f The good news is that if you\u2019re already <a href=\"https:\/\/www.20i.com\/wordpress-hosting\">using 20i WordPress Cloud hosting<\/a>, Redis comes pre-installed on your Cloud Server, so there\u2019s nothing you need to do! If you use a different web host, go ahead and get started with the following steps.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Install and Configure Redis<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The first step is to install Redis on your site\u2019s server. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Redis recommends that you use Linux, which shouldn\u2019t be an issue since this is usually the default server for WordPress sites.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ll also need the following to run Redis:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP version 7.0 or higher<\/li>\n\n\n\n<li>Root and SSH access to your server<\/li>\n\n\n\n<li>A text editor<\/li>\n\n\n\n<li><a href=\"https:\/\/www.gnu.org\/software\/wget\/\">Wget<\/a>, <a href=\"https:\/\/www.sudo.ws\/\">Sudo<\/a>, and <a href=\"https:\/\/www.php.net\/manual\/en\/install.pecl.phpize.php\">Phpize<\/a>&nbsp;<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">When your tools are all ready to go, you can install Redis. Then you\u2019ll need to configure it for caching.\u00a0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019re thinking of switching to <a href=\"https:\/\/www.20i.com\/blog\/what-is-wordpress-multisite-and-how-can-it-benefit-you\/\">WordPress Multisite<\/a> in the future, you\u2019ll also need to edit your <a href=\"https:\/\/docs.20i.com\/support\/wordpress-support\/simple-guide-wp-config.php-what-it-is-and-what-you-should-know\"><em>wp-config.php<\/em> file<\/a> to include a cache key salt:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'WP_CACHE_KEY_SALT', 'mywebsite.com:' );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will prevent any object caching conflicts. Just make sure to replace the placeholder with your site\u2019s name.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Get the Redis PHP Extension<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Next, you\u2019ll need to <a href=\"https:\/\/stackoverflow.com\/questions\/46955555\/how-to-install-redis-extension-for-php-7\">install the Redis PHP extension<\/a>. You can do this using Phpize.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you\u2019re ready, you\u2019ll want to restart Redis and PHP to make sure that everything is working properly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Set Up the Redis Object Cache Plugin<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, you\u2019ll need to install and activate the <a href=\"https:\/\/wordpress.org\/plugins\/redis-cache\/\">Redis Object Cache plugin<\/a> on your site:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"516\" src=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/06\/redis-logo.png\" alt=\"redis logo\" class=\"wp-image-11053\" srcset=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/06\/redis-logo.png 1600w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/redis-logo-300x97.png.webp 300w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/redis-logo-768x248.png.webp 768w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/redis-logo-1536x495.png.webp 1536w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/redis-logo-400x129.png.webp 400w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/redis-logo-800x258.png.webp 800w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/redis-logo-832x268.png.webp 832w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/redis-logo-1248x402.png.webp 1248w, https:\/\/www.20i.com\/blog\/wp-content\/smush-webp\/2023\/06\/redis-logo-150x48.png.webp 150w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then, in your WordPress dashboard, navigate to <em>Settings &gt; Redis<\/em>. Click on the button to <em>Enable Object Cache<\/em>, and you\u2019re done!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Whether you\u2019re running your own business website or managing a suite of client sites, fast loading times are crucial to your success. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Implementing Redis object caching in WordPress can help speed up your site by storing database queries in your server cache.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you opt for a Cloud Server on <a href=\"https:\/\/www.20i.com\/wordpress-hosting\">20i WordPress hosting<\/a>, you\u2019ll get Redis object caching out of the box.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, if you\u2019re using another hosting provider and need to install it manually, just follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Install and configure Redis.<\/li>\n\n\n\n<li>Get the Redis PHP extension.<\/li>\n\n\n\n<li>Set up the <a href=\"https:\/\/wordpress.org\/plugins\/redis-cache\/\">Redis Object Cache plugin<\/a>.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Do you have any questions about installing Redis object caching in WordPress? Let us know in the comments section below!<\/p>\n\n\n<div class='code-block code-block-4' style='margin: 8px 0; clear: both;'>\n<hr>\n<br \/><a href=\"https:\/\/www.20i.com\/wordpress-hosting\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2026\/03\/Blog-Ad-WordPress-1200x625-1.png\" loading=\"lazy\" alt=\"Managed WordPress Hosting\"><\/a><\/div>\n\n","protected":false},"excerpt":{"rendered":"We all know the importance of fast-loading web pages. Google loves them and so do your visitors\/customers. If&hellip;","protected":false},"author":8,"featured_media":11087,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"ub_ctt_via":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"categories":[49,293],"tags":[80,76],"class_list":["post-11052","post","type-post","status-publish","format-standard","has-post-thumbnail","category-business-tips","category-wordpress","tag-seo","tag-wordpress","cs-entry"],"featured_image_src":"https:\/\/www.20i.com\/blog\/wp-content\/uploads\/2023\/06\/Redis-object-caching-and-WordPress.jpg","author_info":{"display_name":"Austin Beresford","author_link":"https:\/\/www.20i.com\/blog\/author\/austinberesford\/"},"_links":{"self":[{"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/posts\/11052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/comments?post=11052"}],"version-history":[{"count":10,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/posts\/11052\/revisions"}],"predecessor-version":[{"id":18133,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/posts\/11052\/revisions\/18133"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/media\/11087"}],"wp:attachment":[{"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/media?parent=11052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/categories?post=11052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.20i.com\/blog\/wp-json\/wp\/v2\/tags?post=11052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}