{"id":5443119,"date":"2023-04-11T12:32:49","date_gmt":"2023-04-11T10:32:49","guid":{"rendered":"https:\/\/wp-rocket.me\/?post_type=caching_hub&#038;p=5443119"},"modified":"2023-05-10T15:40:09","modified_gmt":"2023-05-10T13:40:09","slug":"redis-full-page-cache-vs-nginx-fastcgi","status":"publish","type":"caching_hub","link":"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/","title":{"rendered":"Redis Full-Page Cache vs NGINX FastCGI Cache for WordPress"},"content":{"rendered":"<p>Caching is the backbone of website speed and performance. It\u2019s <a href=\"https:\/\/wp-rocket.me\/blog\/caching-plugin-is-critical-to-your-wordpress-site\/\">critical to your WordPress site\u2019s success<\/a>. Even if your site is hosted on a hefty server, it\u2019ll come to a crawl if you don\u2019t have any caching enabled. Serving websites to tens of thousands of users per day is possible only because of smart caching techniques.<\/p><p>In this article, I\u2019ll pit two distinct WordPress page caching solutions against one another. While <strong>NGINX FastCGI Cache<\/strong> is a tried and tested page caching veteran, <strong>Redis Full-Page Cache<\/strong> is relatively obscure.<\/p><p>Who will come out on top and who will crumble under the load first? As you\u2019ll soon find out, they both have their pros and cons, but there\u2019s only one winner.<\/p><p>Buckle up. Let\u2019s zoom in!<\/p><h2 class=\"wp-block-heading\">WordPress Caching 101<\/h2><p>WordPress requires many moving parts to work. Every time a user requests a page from a WordPress site, the request is first parsed by the server. If the server cannot serve the requested page readily, it\u2019ll process the relevant PHP scripts and assemble the page dynamically. Sometimes, this also involves querying the database to gather additional data.<\/p><p>As a general rule, the longer the request has to travel, the slower the server\u2019s response. If there are a lot of concurrent users, the server can freeze trying to process all the parallel requests.&nbsp;<\/p><p>Caching helps to speed up server response by storing and delivering previously processed requests. A server can deploy many caching layers to store distinct types of data.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"585\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1.png\" alt=\"\" class=\"wp-image-5443128\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1.png 1024w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1-310x177.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1-768x439.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1-105x60.png 105w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1-158x90.png 158w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Page Cache layer is closer to the users (Source: <a href=\"https:\/\/spinupwp.com\/doc\/caching-in-spinupwp\/\">SpinupWP<\/a>)<\/figcaption><\/figure><p>For PHP and database based applications such as WordPress, there are four major types of server-side caching solutions: <strong>Object Caching<\/strong>, <strong>Page Caching<\/strong>, <strong>Opcode Caching<\/strong>, and <strong>CDN Caching<\/strong>. You can read more about all of them in WP Rocket\u2019s <a href=\"https:\/\/wp-rocket.me\/blog\/object-caching-use-wordpress\/\">in-depth article on object caching<\/a>.<\/p><p>This article focuses on comparing page caching solutions, but I suggest you get familiar with the basics of object caching too.&nbsp;&nbsp;<\/p><h2 class=\"wp-block-heading\">Setting Up the Test Site and Server<\/h2><p>I\u2019ll use a $10 standard droplet from DigitalOcean to conduct the tests. With a decent mix of memory and compute resources, it\u2019s a perfect server to test the WordPress site. The droplet configuration includes 2 GB RAM, 1 CPU, 50 GB SSD Storage, and 2 TB transfer.<\/p><p>I\u2019ve installed the test WordPress site on a <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-wordpress-with-lemp-nginx-mariadb-and-php-on-debian-10\">Debian-based LEMP stack<\/a> (Linux, NGINX, MariaDB and PHP 7.3). To stress the test site, I\u2019ve customized it to include a decent mix of static and dynamic elements using WooCommerce and Elementor.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"477\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Base-WP-Cache-Test-Site-WooCommerce.png\" alt=\"\u00a0The test WordPress site used for page cache comparison\" class=\"wp-image-5443135\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Base-WP-Cache-Test-Site-WooCommerce.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Base-WP-Cache-Test-Site-WooCommerce-310x185.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Base-WP-Cache-Test-Site-WooCommerce-768x458.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Base-WP-Cache-Test-Site-WooCommerce-101x60.png 101w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Base-WP-Cache-Test-Site-WooCommerce-151x90.png 151w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">&nbsp;The test WordPress site used for page cache comparison<\/figcaption><\/figure><p>I tested the base site with the GTmetrix website speed testing tool. As you can see from its test report, it\u2019s not yet optimized for performance.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"277\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Base-Test-Site-Performance-Report-GTMetrix.png\" alt=\"GTmetrix report for the test site\" class=\"wp-image-5443145\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Base-Test-Site-Performance-Report-GTMetrix.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Base-Test-Site-Performance-Report-GTMetrix-310x107.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Base-Test-Site-Performance-Report-GTMetrix-768x266.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Base-Test-Site-Performance-Report-GTMetrix-173x60.png 173w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Base-Test-Site-Performance-Report-GTMetrix-260x90.png 260w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">GTmetrix report for the test site<\/figcaption><\/figure><h3 class=\"wp-block-heading\">Stress Testing the Base Site with No Cache Enabled<\/h3><p>I\u2019ll use a free performance testing tool called <a href=\"https:\/\/loader.io\/\">loader.io<\/a> to stress test the website. Their free tier allows you to test two URLs of any website with up to <strong>10000<\/strong> concurrent clients for a minute. That\u2019s more than enough for our use case.&nbsp;<\/p><p><strong>Note:<\/strong> If you\u2019re wondering about the domain name, it\u2019s an unused personal domain. It\u2019s essential to have the site hosted on an actual domain to install an SSL certificate from a signing authority such as Let\u2019s Encrypt. With an SSL certificate installed, the site has to perform an HTTPS handshake for every unique client request. This mimics real-world usage better during the stress test.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"609\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-200-Clients.png\" alt=\"\" class=\"wp-image-5443156\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-200-Clients.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-200-Clients-256x195.png 256w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-200-Clients-768x585.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-200-Clients-79x60.png 79w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-200-Clients-118x90.png 118w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Loader.io test results for the base site<\/figcaption><\/figure><p>You can check the test parameters inside the orange box on the left side. Note the <strong>0 to 200 clients over 1 min<\/strong> test parameter. This means that loader.io will stress test the website by slowly increasing the number of active clients from 0 to 100 over a 1 minute period.&nbsp;<\/p><p>In the graph shown, the green line represents the number of concurrent clients and the blue line represents the average server response time. You can see that the response time creeps upwards as the number of clients increases.&nbsp;<\/p><p>Loader.io aborted the test after 36 seconds as more than 50% of the requests weren\u2019t successful (a timeout or an HTTP 400\/500 error response). Also, the <strong>17.33 seconds<\/strong> average response time doesn\u2019t bode well for the user experience either.<\/p><p>Checking the <strong>Details<\/strong> tab will give you a better understanding of when the server timeouts start. You can see that it starts at the <strong>25-second<\/strong> mark.&nbsp;&nbsp;<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"405\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-200-Clients-Details.png\" alt=\"That\u2019s a lot of 500 Internal Server Errors\" class=\"wp-image-5443167\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-200-Clients-Details.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-200-Clients-Details-310x157.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-200-Clients-Details-768x389.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-200-Clients-Details-119x60.png 119w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-200-Clients-Details-178x90.png 178w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">That\u2019s a lot of 500 Internal Server Errors<\/figcaption><\/figure><p>I ran the test again, this time limiting the number of concurrent clients to <strong>100<\/strong>. The base site struggled to perform even under this minimal load.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"573\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader-100-Clients.png\" alt=\"Repeating the test with a max of 100 active clients\" class=\"wp-image-5443175\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader-100-Clients.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader-100-Clients-272x195.png 272w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader-100-Clients-768x550.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader-100-Clients-84x60.png 84w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader-100-Clients-126x90.png 126w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Repeating the test with a max of 100 active clients<\/figcaption><\/figure><p>The test ran for a full minute this time around, but the average server response time is still unacceptable. Every active user stresses the server more, which makes it respond slowly to all the other users. The server timeouts still persist.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"397\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-100-Clients-Details.png\" alt=\"Server timeouts persist as the number of active clients increases\" class=\"wp-image-5443183\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-100-Clients-Details.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-100-Clients-Details-310x154.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-100-Clients-Details-768x381.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-100-Clients-Details-121x60.png 121w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-100-Clients-Details-181x90.png 181w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Server timeouts persist as the number of active clients increases<\/figcaption><\/figure><p>From the above graph you will notice that server timeouts start to occur at the <strong>38 second<\/strong> mark in the test.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"572\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-100-Clients.png\" alt=\"There are 68 active clients at the 38 second mark\" class=\"wp-image-5443191\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-100-Clients.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-100-Clients-273x195.png 273w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-100-Clients-768x549.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-100-Clients-84x60.png 84w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Base-Site-Loader.io-100-Clients-126x90.png 126w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">There are 68 active clients at the 38 second mark<\/figcaption><\/figure><p>Now you have a fair idea of how the base site performs when there are 100 and 200 active clients. It\u2019s time to perform the same tests with <strong>Redis Page Cache<\/strong> or <strong>NGINX FastCGI Cache<\/strong> enabled on the server.<\/p><div id=\"om-olkrjzfbhlynbs54rv6z-holder\"><\/div>\n\t<script>(function (d, u, ac) {\n\t\t\tvar s = d.createElement('script')\n\t\t\ts.type = 'text\/javascript'\n\t\t\ts.src = 'https:\/\/a.omappapi.com\/app\/js\/api.min.js'\n\t\t\ts.async = true\n\t\t\ts.dataset.user = u\n\t\t\ts.dataset.campaign = ac\n\t\t\td.getElementsByTagName('head')[0].appendChild(s)\n\t\t})(document, 20440, 'olkrjzfbhlynbs54rv6z')<\/script><h2 class=\"wp-block-heading\">What is Redis Full-Page Cache?<\/h2><p>Redis (<strong>Re<\/strong>mote <strong>Di<\/strong>ctionary <strong>Se<\/strong>rver) is an extremely fast in-memory data store for a database, cache, proxy, and more.&nbsp;<\/p><p>Since Redis stores its data in-memory, as opposed to traditional databases that store data on physical disks or SSDs, Redis can seek and deliver data super fast.&nbsp;<\/p><p>As in-memory storage is costlier to scale on a web server, Redis is ideal for caching smaller files such as database query results and persistent sessions. Thus, Redis is typically used to <a href=\"https:\/\/wp-rocket.me\/blog\/redis-object-caching\/\">enable object caching<\/a> and not page caching.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"999\" height=\"484\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Object-Cache-Plugin-Dashboard.png\" alt=\"Redis Object Cache plugin settings screen (Source: WordPress.org)\" class=\"wp-image-5443200\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Object-Cache-Plugin-Dashboard.png 999w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Object-Cache-Plugin-Dashboard-310x150.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Object-Cache-Plugin-Dashboard-768x372.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Object-Cache-Plugin-Dashboard-124x60.png 124w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Object-Cache-Plugin-Dashboard-186x90.png 186w\" sizes=\"(max-width: 999px) 100vw, 999px\" \/><figcaption class=\"wp-element-caption\">Redis Object Cache plugin settings screen (Source: <a href=\"https:\/\/wordpress.org\/plugins\/redis-cache\/\">WordPress.org<\/a>)<\/figcaption><\/figure><p>The smart folks over at Pressjitsu adapted the unique features of the Redis server and implemented a Redis-backed <a href=\"https:\/\/pressjitsu.com\/blog\/redis-page-cache-for-wordpress\/\">page caching solution for WordPress<\/a>. It uses Redis\u2019 <strong>maxmemory #mb<\/strong> and <strong>maxmemory-policy allkeys-lru<\/strong> directives to ensure that the server utilizes its limited volatile memory efficiently by removing older cached pages to make room for fresh ones.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"363\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-Plugin-WP-Repo.png\" alt=\"Redis Page Cache plugin on WordPress.org repo\" class=\"wp-image-5443209\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-Plugin-WP-Repo.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-Plugin-WP-Repo-310x141.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-Plugin-WP-Repo-768x348.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-Plugin-WP-Repo-132x60.png 132w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-Plugin-WP-Repo-198x90.png 198w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Redis Page Cache plugin on WordPress.org repo<\/figcaption><\/figure><p>Redis Page Cache stores and serves the full-page cache from in-memory store, just like how Redis Object Cache works. Technically, this should make it a highly fast cache.&nbsp;&nbsp;<\/p><h3 class=\"wp-block-heading\">How to Enable Redis Page Cache<\/h3><p>The documentation to enable the Redis Page Cache plugin is a bit inconsistent. After some trial and error, I got it working on my setup. Here are the steps I followed:<\/p><p>1. Before installing the plugin, make sure you have the Redis server installed and running on your web server. If you\u2019re using Debian\/Ubuntu, here\u2019s the command to install it via terminal:<\/p><pre class=\"wp-block-code\"><code class=\"\">sudo apt-get install redis-server<\/code><\/pre><p>I highly recommend you to <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-secure-redis-on-ubuntu-18-04\">follow Digital Ocean\u2019s tutorial on installing and securing Redis<\/a> on your Linux distro. If you have any other variant of Linux, they also have separate tutorials catering to almost every major Linux distro.&nbsp;<\/p><p>&nbsp;2. Once you\u2019ve installed and configured Redis on your web server, you need to install the <a href=\"https:\/\/github.com\/phpredis\/phpredis\">PhpRedis extension<\/a> on your server. It provides an API for PHP to communicate with the Redis key-value store.<\/p><pre class=\"wp-block-code\"><code class=\"\">sudo apt-get install php-redis<\/code><\/pre><p>Restart your PHP server after installing the PhpRedis extension. You can do it with the following command:<\/p><pre class=\"wp-block-code\"><code class=\"\">sudo service php7.3-fpm restart<\/code><\/pre><p id=\"block-8d740d1e-a433-4c2d-9ea0-893d076ac1af\"><strong>Note:<\/strong> My web server runs PHP 7.3 version. You need to use a command corresponding to your web server\u2019s PHP version.<br><br>3. You need to ensure that the Redis server has enough memory allocated to store the page caches. Redis Page Cache recommends that you allocate at least <strong>16 MB<\/strong> just for page caching. You can do this by adding the following line to your <strong>redis.conf<\/strong> file:&nbsp;<\/p><pre class=\"wp-block-code\"><code class=\"\">maxmemory 256mb<\/code><\/pre><p>I\u2019ve allocated <strong>256 MB<\/strong> to the Redis server. Since the plugin compresses the cache using gzip to lower memory usage, it should be more than enough to store all the page caches.<\/p><p>Next, add the following memory policy to ensure that Redis evicts older caches to make room for fresh ones.<\/p><pre class=\"wp-block-code\"><code class=\"\">maxmemory-policy allkeys-lru<\/code><\/pre><p>Restart the Redis server after saving your changes in the configuration file. Here\u2019s the command to restart Redis:<\/p><pre class=\"wp-block-code\"><code class=\"\">sudo systemctl restart redis.service<\/code><\/pre><p>4. Now you need to install and activate the <strong>Redis Page Cache<\/strong> plugin. You can either install it manually from its open source <a href=\"https:\/\/github.com\/pressjitsu\/pj-page-cache-red\/\">GitHub repository<\/a> or directly via <a href=\"https:\/\/wordpress.org\/plugins\/pj-page-cache-red\/\">WordPress.org<\/a>.<\/p><p><strong>Note: <\/strong>If you install the plugin directly via WordPress.org, the plugin\u2019s slug (or its directory name) is <strong>pj-page-cache-red<\/strong>. But if you download it directly through its GitHub repo, the slug is <strong>redis-page-cache<\/strong>. Remember where you\u2019ve installed from as you need to use the correct slug in the next step.&nbsp;<br><br>5. Next, you need to create<\/p><pre class=\"wp-block-code\"><code class=\"\">cd \/var\/www\/your-domain.com\/wp-content<\/code><\/pre><p id=\"block-74533492-e64e-47df-b4c4-06944e26a33a\">You can now create a symlink inside the <strong>wp-content<\/strong> directory by using the <strong>ln -s<\/strong> command.<\/p><pre class=\"wp-block-code\"><code class=\"\">sudo ln -s plugins\/pj-page-cache-red\/advanced-cache.php advanced-cache.php<\/code><\/pre><p>6. Finally, you need to enable page caching in your WordPress site by editing its <strong>wp-config.php<\/strong> file.<br>Add the following code snippet above the line that says <strong>\/* That&#8217;s all, stop editing! Happy blogging. *\/<\/strong><\/p><pre class=\"wp-block-code\"><code class=\"\">define( 'WP_CACHE', true );<\/code><\/pre><p id=\"block-d4445826-a955-451f-b799-22ad2f739eb2\"><strong>Note:<\/strong> The location where you add the above code snippet is very important.<\/p><p id=\"block-b85be75f-64f6-4a0f-a0ff-2bb8fe35f78b\">You\u2019ve finished setting up <strong>Redis Page Cache<\/strong> for your WordPress site.&nbsp;<\/p><p id=\"block-6a17cfa8-e819-4624-a162-6f22fd0cae02\">Before load testing the website, let\u2019s check whether the page cache works as intended. You can test this by visiting the site in incognito mode, or by using the cURL command:<\/p><pre class=\"wp-block-code\"><code class=\"\">curl -v https:\/\/example.com -o \/dev\/null<\/code><\/pre><p>If the page cache is working as intended, then you should see an <strong>X-Pj-Cache-Status<\/strong> response header with the <strong>hit<\/strong> value.<\/p><pre class=\"wp-block-code\"><code class=\"\">&lt; X-Pj-Cache-Status: hit<\/code><\/pre><p>If the value shown is \u201c<strong>miss<\/strong>\u201d the first time around, try running the command again or refreshing the page. You need to do this as the cache gets saved only after the page has been loaded at least once.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"411\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-X-Pj-Cache-Status-Hit.png\" alt=\"\u00a0\u201cX-Pj-Cache-Status: hit\u201d indicates Redis Page Cache is working\" class=\"wp-image-5443225\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-X-Pj-Cache-Status-Hit.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-X-Pj-Cache-Status-Hit-310x159.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-X-Pj-Cache-Status-Hit-768x395.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-X-Pj-Cache-Status-Hit-117x60.png 117w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-X-Pj-Cache-Status-Hit-175x90.png 175w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">&nbsp;\u201c<strong>X-Pj-Cache-Status:<\/strong> hit\u201d indicates Redis Page Cache is working<\/figcaption><\/figure><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"411\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-X-Pj-Cache-Status-Hit-Terminal.png\" alt=\"Checking the cache status directly inside the terminal\" class=\"wp-image-5443233\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-X-Pj-Cache-Status-Hit-Terminal.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-X-Pj-Cache-Status-Hit-Terminal-310x159.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-X-Pj-Cache-Status-Hit-Terminal-768x395.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-X-Pj-Cache-Status-Hit-Terminal-117x60.png 117w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Redis-Page-Cache-X-Pj-Cache-Status-Hit-Terminal-175x90.png 175w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Checking the cache status directly inside the terminal<\/figcaption><\/figure><p>Congrats, you\u2019ve now verified that Redis Page Cache is working on your website.&nbsp;<\/p><p>You can also <a href=\"https:\/\/github.com\/pressjitsu\/pj-page-cache-red\/#configuring-the-plugin\">configure the Redis Page Cache plugin<\/a> to define how it should work. For this example, I\u2019ll stick to the default settings.<\/p><h3 class=\"wp-block-heading\">Stress Test with Redis Page Cache Enabled<\/h3><p>Let\u2019s stress test the dummy site to see how it holds up with Redis Page Cache enabled. I\u2019ll fire up loader.io and perform the load test with the maximum number of concurrent clients set to <strong>100<\/strong>.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"564\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-100-Clients.png\" alt=\"Loader.io test results for 0-100 clients with Redis Page Cache enabled\" class=\"wp-image-5443240\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-100-Clients.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-100-Clients-277x195.png 277w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-100-Clients-768x541.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-100-Clients-85x60.png 85w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-100-Clients-128x90.png 128w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Loader.io test results for 0-100 clients with Redis Page Cache enabled<\/figcaption><\/figure><p>I repeated the test five times to ensure that the results are consistent. With an average response time of <strong>478 ms<\/strong> and no errors, we can conclude that the site works splendidly with the page cache enabled.&nbsp;<\/p><p>As the number of concurrent clients increases (the green line), the response time stays relatively constant (the blue line). That\u2019s one of the best indicators that a server can handle many active users without affecting page load speed.<\/p><p>Let\u2019s perform the test again, but this time with a maximum of 200 concurrent clients.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"559\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-Details.png\" alt=\"Loader.io test results for 0-200 clients with Redis Page Cache enabled\" class=\"wp-image-5443247\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-Details.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-Details-279x195.png 279w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-Details-768x537.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-Details-86x60.png 86w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-Details-129x90.png 129w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Loader.io test results for 0-200 clients with Redis Page Cache enabled<\/figcaption><\/figure><p>The site still performs well with no errors and an average response time of <strong>757 ms<\/strong>.<\/p><p>In the graph above, you\u2019ll notice a spike in response time at the <strong>22-second<\/strong> mark. After this point, the server response time climb upwards as the number of active clients increases. According to a study by rackAID, you need to keep your server response time less than <strong>500 ms<\/strong> to maintain a good user experience.&nbsp;<\/p><p>At the end of the test with <strong>200<\/strong> active users, the server response time climbed to over <strong>1200 ms<\/strong>. That\u2019s far from ideal.&nbsp;<\/p><p><strong>Note:<\/strong> Caching is just one of the many ways to reduce server response time. For more information on this topic, refer to <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/reduce-ttfb-server-response-times\/\">WP Rocket\u2019s article on reducing TTFB<\/a>.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"559\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients.png\" alt=\"The server response time is fast and flat up until 78 active clients\" class=\"wp-image-5443256\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-279x195.png 279w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-768x537.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-86x60.png 86w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-129x90.png 129w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">The server response time is fast and flat up until 78 active clients<\/figcaption><\/figure><p>Serving <strong>78<\/strong> concurrent clients with no performance loss is excellent. Assuming that every user spends an average of 2 minutes on any page, it translates to serving over 1.5 million page requests every month facing no server hiccups.<\/p><p>Let\u2019s push the server\u2019s limits more. I\u2019ll stress test it again with the maximum number of active clients set to <strong>250<\/strong>.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"564\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-1.png\" alt=\"Loader.io test results for 0-250 clients with Redis Page Cache enabled\" class=\"wp-image-5443265\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-1.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-1-277x195.png 277w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-1-768x541.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-1-85x60.png 85w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-200-Clients-1-128x90.png 128w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Loader.io test results for 0-250 clients with Redis Page Cache enabled<\/figcaption><\/figure><p>The results look consistent with the previous test, but this time <strong>5.1%<\/strong> of the server\u2019s responses were HTTP 400\/500 errors. Looking at the <strong>Details<\/strong> tab will give us more information about when the error responses first occurred.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"560\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-250-Clients-Details.png\" alt=\"Details tab for the 0-250 clients test with Redis Page Cache enabled\" class=\"wp-image-5443273\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-250-Clients-Details.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-250-Clients-Details-279x195.png 279w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-250-Clients-Details-768x538.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-250-Clients-Details-86x60.png 86w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-250-Clients-Details-129x90.png 129w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Details tab for the 0-250 clients test with Redis Page Cache enabled<\/figcaption><\/figure><p>The <strong>HTTP 500x<\/strong> errors first occurred at the <strong>51 second<\/strong> mark. The total number of active clients was <strong>218<\/strong> in the test.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"560\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-250-Clients.png\" alt=\"218 active clients is the stress limit for this test scenario\" class=\"wp-image-5443280\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-250-Clients.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-250-Clients-279x195.png 279w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-250-Clients-768x538.png 768w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-250-Clients-86x60.png 86w, https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/WP-Cache-Test-Redis-Page-Cache-Loader.io-250-Clients-129x90.png 129w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">218 active clients is the stress limit for this test scenario<\/figcaption><\/figure><p>The data points above will give you a fair idea of how many active clients the site can handle without errors.&nbsp;<\/p><p>From the above tests we can conclude that Redis Page Cache improves the performance of the site considerably. Now let\u2019s move on to testing the site with NGINX FastCGI Cache enabled.<\/p><h2 class=\"wp-block-heading\">What is NGINX FastCGI Cache?<\/h2><p>NGINX is a popular, high-performance web server that can host WordPress sites. Apart from being a web server, it\u2019s also used as a reverse proxy, mail proxy, load balancer, and HTTP cache.<\/p><p>As per W3Techs, <a href=\"https:\/\/w3techs.com\/technologies\/details\/ws-nginx\">32.1% of websites are installed on an NGINX web server<\/a> (May 25, 2020). Most performance-focused WordPress hosts use NGINX to power their websites today.<\/p><p>Caching on NGINX is mainly powered by its FastCGI Cache module. According to a <a href=\"https:\/\/spinupwp.com\/page-caching-varnish-vs-nginx-fastcgi-cache-2018\/\">benchmarking test done by SpinupWP<\/a>, NGINX FastCGI Cache was the fastest and the most efficient caching solution of the lot.<\/p><h3 class=\"wp-block-heading\">How to Enable NGINX FastCGI Cache<\/h3><p>You can only enable NGINX FastCGI Cache on a web server that has NGINX installed. Since I\u2019ve already installed NGINX as my webserver, I\u2019ll just reset it to its base configuration to remove any traces of Redis.&nbsp;&nbsp;<\/p><p>You can learn how to use NGINX FastCGI Cache on your WordPress site by visiting <a href=\"https:\/\/wp-rocket.me\/blog\/nginx-caching-for-wordpress\/\">WP Rocket\u2019s article on NGINX caching<\/a>. You can also check out our <a href=\"https:\/\/wp-rocket.me\/blog\/cache-dynamic-content-wordpress\/\">Caching Dynamic Content in WordPress<\/a> article for an in-depth tutorial on how to enable NGINX FastCGI Cache.<\/p><p>Before stress testing the site, let\u2019s verify that FastCGI Cache works on the site by checking its response headers.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"361\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/NGINX-FastCGI-Cache-Status-HIT.png\" alt=\"\u201cFastcgi-Cache: HIT\u201d response header confirms that FastCGI Cache is enabled\" class=\"wp-image-2384694\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/NGINX-FastCGI-Cache-Status-HIT.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/NGINX-FastCGI-Cache-Status-HIT-300x135.png 300w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/NGINX-FastCGI-Cache-Status-HIT-768x347.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">\u201c<strong>Fastcgi-Cache: HIT<\/strong>\u201d response header confirms that FastCGI Cache is enabled<\/figcaption><\/figure><p>Now let\u2019s move ahead with the stress test on loader.io.<\/p><h3 class=\"wp-block-heading\">Stress Test with NGINX FastCGI Cache Enabled<\/h3><p>First, I\u2019ll test the site by setting the maximum number of active clients to <strong>100<\/strong>.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"559\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-100-Clients.png\" alt=\"WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-100-Clients\" class=\"wp-image-2384699\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-100-Clients.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-100-Clients-279x195.png 279w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-100-Clients-768x537.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-100-Clients<\/figcaption><\/figure><p>As expected, the site performs exceptionally well after enabling page cache. The average server response time stays below <strong>400 ms<\/strong> even as the number of active clients reaches <strong>100<\/strong> (the maximum number set by me).<\/p><p>Now let\u2019s increase the maximum number of active clients to <strong>200 <\/strong>and repeat the stress test.<\/p><figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"559\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-200-Clients.png\" alt=\"WP Cache Loader.io test results for 0-200 clients with NGINX FastCGI Cache enabled\" class=\"wp-image-2384705\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-200-Clients.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-200-Clients-300x210.png 300w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-200-Clients-768x537.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Loader.io test results for 0-200 clients with NGINX FastCGI Cache enabled<\/figcaption><\/figure><p>Even after increasing the max number of active clients, the average server response time still stays below <strong>400 ms<\/strong>. We already have a clear winner.&nbsp;<\/p><p>But how far can we push the server? Loader.io allows you to set the maximum number of active clients to a whopping <strong>10000<\/strong>. So, I tested with this max setting to see whether the server will keep up.<\/p><figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"559\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-10000-Clients.png\" alt=\"WP Cache Loader.io test results for 0-10000 clients with NGINX FastCGI Cache enabled\" class=\"wp-image-2384712\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-10000-Clients.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-10000-Clients-279x195.png 279w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-10000-Clients-768x537.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Loader.io test results for 0-10000 clients with NGINX FastCGI Cache enabled<\/figcaption><\/figure><p>Surprisingly, the server kept up. However, the test results showed a <strong>19.7%<\/strong> error rate (timeouts in this case) and an average server response time of <strong>4464 ms<\/strong>.<\/p><p>I kept reducing the max number of clients by half to find out the site\u2019s stress limit with NGINX FastCGI Cache enabled. Finally, I arrived at two numbers.&nbsp;<\/p><figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"559\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-800-Clients.png\" alt=\"WP Cache Loader.io test results for 0-800 clients with NGINX FastCGI Cache enabled\" class=\"wp-image-2384753\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-800-Clients.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-800-Clients-279x195.png 279w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-800-Clients-768x537.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Loader.io test results for 0-800 clients with NGINX FastCGI Cache enabled<\/figcaption><\/figure><p>With the max number of active clients set to <strong>800<\/strong>, the average server response time is <strong>596 ms<\/strong>. However, the server timeouts start towards the end of the test after reaching <strong>760<\/strong> active clients. The stress limit for NGINX FastCGI Cache is <strong>3.5x<\/strong> times that of what we observed with Redis Page Cache.<\/p><figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"559\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-800-Clients-Details.png\" alt=\"WP Cache Loader.io test for 800 clients: The server timeouts start at the 56 second mark\" class=\"wp-image-2384766\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-800-Clients-Details.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-800-Clients-Details-300x210.png 300w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-800-Clients-Details-768x537.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">The server timeouts start at the 56 second mark<\/figcaption><\/figure><p>I\u2019ll perform another stress test to find the number of active clients the server can handle without compromising on average response time (&lt;<strong>500 ms<\/strong>). For this test, I\u2019m setting the max number of concurrent clients to <strong>500<\/strong>.<\/p><figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"559\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-500-Clients.png\" alt=\"WP Cache Loader.io test results for 0-500 clients with NGINX FastCGI Cache enabled\" class=\"wp-image-2384771\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-500-Clients.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-500-Clients-279x195.png 279w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/WP-Cache-Test-NGINX-FastCGI-Cache-Loader.io-500-Clients-768x537.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Loader.io test results for 0-500 clients with NGINX FastCGI Cache enabled<\/figcaption><\/figure><p>The server\u2019s response time reaches over <strong>500 ms<\/strong> at the <strong>44 second<\/strong> mark and keeps moving upwards. The number of active clients at this point is <strong>375<\/strong>. Hence, we can deduce that the server can handle <strong>375<\/strong> concurrent clients without affecting the response time. That\u2019s <strong>4.8x<\/strong> times the number of active clients supported by Redis Page Cache.&nbsp;&nbsp;<\/p><p>Assuming that every user spends an average of 2 minutes on any page, it translates to serving 8.1 million page requests every month facing no server hiccups. Not bad for a site hosted on a $10\/month server.<\/p><div id=\"om-ulrdquoprwqcywqbbgci-holder\"><\/div>\n\t<script>(function (d, u, ac) {\n\t\t\tvar s = d.createElement('script')\n\t\t\ts.type = 'text\/javascript'\n\t\t\ts.src = 'https:\/\/a.omappapi.com\/app\/js\/api.min.js'\n\t\t\ts.async = true\n\t\t\ts.dataset.user = u\n\t\t\ts.dataset.campaign = ac\n\t\t\td.getElementsByTagName('head')[0].appendChild(s)\n\t\t})(document, 20440, 'ulrdquoprwqcywqbbgci')<\/script><h2 class=\"wp-block-heading\">Summing Up The Stress Tests<\/h2><p>Redis Page Cache is a smart implementation of full-page caching for WordPress sites. Compared to having no page caching enabled, it helps improve the site performance considerably.&nbsp;<\/p><p>However, NGINX FastCGI Cache beat Redis Page Cache in all the stress tests performed. Below is a comparison chart of both their stress tests. The results are conclusive and speak for themselves.<\/p><figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"461\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/Redis-Page-Cache-vs-NGINX-FastCGI-Cache.png\" alt=\"NGINX FastCGI Cache is the clear winner\" class=\"wp-image-2384778\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/Redis-Page-Cache-vs-NGINX-FastCGI-Cache.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/Redis-Page-Cache-vs-NGINX-FastCGI-Cache-310x179.png 310w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/Redis-Page-Cache-vs-NGINX-FastCGI-Cache-768x443.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">NGINX FastCGI Cache is the clear winner<\/figcaption><\/figure><h2 class=\"wp-block-heading\">Wrapping Up<\/h2><p>You don\u2019t need expensive hosting to optimize your site\u2019s performance if you know how to enable page caching. Almost all managed WordPress hosts do exactly this to speed up WordPress sites.<\/p><p>If you\u2019d like to dive deeper, you can club NGINX FastCGI Cache with Redis object caching to optimize the site\u2019s performance even further. There\u2019s also a custom NGINX configuration for WP Rocket called <a href=\"https:\/\/docs.wp-rocket.me\/article\/37-nginx-configuration-for-wp-rocket\">Rocket-Nginx<\/a>. It enables NGINX and WP Rocket to serve cached files directly without calling WordPress or running PHP.&nbsp;<\/p><p>Page caching is an excellent choice to speed up your website. Choosing the right page caching solution for your WordPress site can be highly confusing. I hope this article answered some of your doubts.&nbsp;<\/p><p>If you\u2019re still not sure about WordPress page caching or are stuck somewhere, don\u2019t hesitate to leave a comment below!<\/p>","protected":false},"excerpt":{"rendered":"<p>Caching is the backbone of website speed and performance. It\u2019s critical to your WordPress site\u2019s success. Even if your site is hosted on a hefty server, it\u2019ll come to a crawl if you don\u2019t have any caching enabled. Serving websites to tens of thousands of users per day is possible only because of smart caching [&hellip;]<\/p>\n","protected":false},"template":"","class_list":["post-5443119","caching_hub","type-caching_hub","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Redis Full-Page Cache vs NGINX FastCGI Cache for WordPress<\/title>\n<meta name=\"description\" content=\"Redis Full-Page Cace vs NGINX FastCGI Cache: Which is faster? They both have their pros and cons, but there\u2019s only one winner. Find it out with now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Redis Full-Page Cache vs NGINX FastCGI Cache for WordPress\" \/>\n<meta property=\"og:description\" content=\"Redis Full-Page Cace vs NGINX FastCGI Cache: Which is faster? They both have their pros and cons, but there\u2019s only one winner. Find it out with now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Rocket\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-10T13:40:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@wp_rocket\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/\",\"url\":\"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/\",\"name\":\"Redis Full-Page Cache vs NGINX FastCGI Cache for WordPress\",\"isPartOf\":{\"@id\":\"https:\/\/wp-rocket.me\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1.png\",\"datePublished\":\"2023-04-11T10:32:49+00:00\",\"dateModified\":\"2023-05-10T13:40:09+00:00\",\"description\":\"Redis Full-Page Cace vs NGINX FastCGI Cache: Which is faster? They both have their pros and cons, but there\u2019s only one winner. Find it out with now!\",\"breadcrumb\":{\"@id\":\"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/#primaryimage\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1.png\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1.png\",\"width\":1024,\"height\":585},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wp-rocket.me\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WordPress Cache\",\"item\":\"https:\/\/wp-rocket.me\/wordpress-cache\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Redis Full-Page Cache vs NGINX FastCGI Cache for WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wp-rocket.me\/#website\",\"url\":\"https:\/\/wp-rocket.me\/\",\"name\":\"WP Rocket\",\"description\":\"Plugin d&#039;optimisation de sites WordPress\",\"publisher\":{\"@id\":\"https:\/\/wp-rocket.me\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wp-rocket.me\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/wp-rocket.me\/#organization\",\"name\":\"WP Rocket\",\"url\":\"https:\/\/wp-rocket.me\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"width\":150,\"height\":41,\"caption\":\"WP Rocket\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\",\"https:\/\/x.com\/wp_rocket\",\"https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Redis Full-Page Cache vs NGINX FastCGI Cache for WordPress","description":"Redis Full-Page Cace vs NGINX FastCGI Cache: Which is faster? They both have their pros and cons, but there\u2019s only one winner. Find it out with now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/","og_locale":"en_US","og_type":"article","og_title":"Redis Full-Page Cache vs NGINX FastCGI Cache for WordPress","og_description":"Redis Full-Page Cace vs NGINX FastCGI Cache: Which is faster? They both have their pros and cons, but there\u2019s only one winner. Find it out with now!","og_url":"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/","og_site_name":"WP Rocket","article_publisher":"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","article_modified_time":"2023-05-10T13:40:09+00:00","og_image":[{"url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1.png"}],"twitter_card":"summary_large_image","twitter_site":"@wp_rocket","twitter_misc":{"Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/","url":"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/","name":"Redis Full-Page Cache vs NGINX FastCGI Cache for WordPress","isPartOf":{"@id":"https:\/\/wp-rocket.me\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/#primaryimage"},"image":{"@id":"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/#primaryimage"},"thumbnailUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1.png","datePublished":"2023-04-11T10:32:49+00:00","dateModified":"2023-05-10T13:40:09+00:00","description":"Redis Full-Page Cace vs NGINX FastCGI Cache: Which is faster? They both have their pros and cons, but there\u2019s only one winner. Find it out with now!","breadcrumb":{"@id":"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/#primaryimage","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1.png","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/2023\/04\/Browser-Page-Object-Cache-Levels-1024x585-1.png","width":1024,"height":585},{"@type":"BreadcrumbList","@id":"https:\/\/wp-rocket.me\/wordpress-cache\/redis-full-page-cache-vs-nginx-fastcgi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wp-rocket.me"},{"@type":"ListItem","position":2,"name":"WordPress Cache","item":"https:\/\/wp-rocket.me\/wordpress-cache\/"},{"@type":"ListItem","position":3,"name":"Redis Full-Page Cache vs NGINX FastCGI Cache for WordPress"}]},{"@type":"WebSite","@id":"https:\/\/wp-rocket.me\/#website","url":"https:\/\/wp-rocket.me\/","name":"WP Rocket","description":"Plugin d&#039;optimisation de sites WordPress","publisher":{"@id":"https:\/\/wp-rocket.me\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wp-rocket.me\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wp-rocket.me\/#organization","name":"WP Rocket","url":"https:\/\/wp-rocket.me\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","width":150,"height":41,"caption":"WP Rocket"},"image":{"@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","https:\/\/x.com\/wp_rocket","https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q"]}]}},"_links":{"self":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/caching_hub\/5443119"}],"collection":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/caching_hub"}],"about":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/types\/caching_hub"}],"wp:attachment":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/media?parent=5443119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}