Đánh giá wp fasted cache nginx năm 2024

Have done some study and actual testing over various cache plugins over the past a few months, and I’ve decided to sit down with W3 Total Cache.

Though there are reviews out there that WP Rocket and FlyingPress are (marginally) faster than W3 Total Cache, they are

  1. Available only for premium
  2. Not as feature rich as W3 Total Cache

W3TC also has pro version which I am going to apply for a few hot subsites in my multisite, but overall, even without the paid version, it does give me decisive speed improvement against competitors. Caching for Rest API and WebP conversion for all my images, both of which are provided in pro version, are two functions that I believe can level up the web loading speed, but again, without them, I still have over 90 in Google’s website check.

What I like the most of this plugin is CDN option that I can customize freely. Have been relying on other plugins dedicated to Amazon S3, but I am now much happy to integrate all speed related functionality into one plugin.

I also like W3TC’s additional server setting lines for Nginx. Though I was already informed by third party reviews, when I first saw lines of Nginx server settings on W3TC’s initial set-up, I was a bit overwhelmed, but then I figured that it is more suited to WordPress than my original version. I removed my lines in nginx.conf.

There are other functionalities that I have to study, which might not be welcoming for those people looking for a quick and easy solution, but I am always happy with additional possibilities. My next goal is to add Varnish cache server, and I just found that W3TC also has a menu for that as well. This functionality was not available in any other cache plugins that I have tested so far. For every server, it creates a lot of headache in setting, but with the help of W3TC, I can go really far with much less stress.

In all, if you are willing to study, W3TC offers so many features that will eventually help you to enjoy faster loading.

It is no secret that Nginx FastCGI Cache can drastically increase your WordPress performance by improving server response time and reducing the load on PHP-FPM and MySQL/MariaDB server.

Nginx FastCGI Cache is usually an advanced topic for developer experts or sysadmins who are familiar with linux commands and the Nginx config.

In this post, we will enlighten everyone from beginner to expert for this topic, and make Nginx FastCGI Cache (RunCache) as one of your top favourite features in RunCloud.

What is Nginx FastCGI Cache

Before we talk about Nginx FastCGI Cache, let’s talk about how your website works.

  1. When a user visits your WordPress page, the web browser sends an HTTP/HTTPS request to Nginx.
  2. Nginx passes the request to PHP-FPM and Nginx will catch any PHP codes when trying to grabbing the page.
  3. PHP-FPM processes the page and runs through the MariaDB/MySQL database query to retrieve the page.
  4. PHP-FPM sends the generated “static” HTML page back to Nginx.
  5. Nginx send the generated HTML page to the web browser for the user.

Đánh giá wp fasted cache nginx năm 2024

When using Nginx FastCGI, this built-in Nginx module will be in between Nginx and PHP-FPM and it is able to generate a cached HTML page from PHP-FPM.

When another user visits the same WordPress page, your website will not perform the same PHP and database requests again because the page is already cached and served by FastCGI.

As a result, your server response time will be much faster after the initial load.

Your PHP-FPM and MariaDB/MySQL load will be reduced.

Your server CPU resource usage will be lower.

And finally, your server can handle more traffic with the same server specifications when using Nginx FastCGI Cache, ultimately allowing you to keep a more affordable server without having to scale any further.

Đánh giá wp fasted cache nginx năm 2024

Nginx FastCGI Cache vs Varnish Cache

When talking about server-side caching mechanism, Varnish is also one of the top popular choices.

Unfortunately, Varnish is designed to accelerate HTTP and doesn’t support the HTTPS protocol.

After Let’s Encrypt provides a free SSL/TLS for everyone and Google encourages HTTPS Everywhere and made the move to boost search engine rankings for sites using HTTPS URLS, most websites use HTTPS now for their website to ensure safety from online threats.

There is a workaround to use Varnish with HTTPS, by adding an SSL/TLS terminator in front of Varnish to convert HTTPS to HTTP.

Nginx FastCGI does support HTTPS protocol, which is an excellent alternative to Varnish, without having to increase any complexity in the server.

Nginx FastCGI Cache (RunCache) vs WordPress Cache Plugins

Many WordPress users ask the same question, which one is better?

Actually, both are good for your WordPress website.

When using regular shared hosting, Nginx FastCGI is not available and the only option available is the WordPress cache plugin.

You will need a VPS / Dedicated server to allow you to optimize your WordPress site using Nginx FastCGI Cache.

With proper setup, Nginx FastCGI Cache can perform better than any WordPress cache plugin.

Who Need Nginx FastCGI Cache (RunCache) For WordPress

All WordPress pages can gain huge benefits when using Nginx FastCGI Cache (RunCache).

For blogs, magazines, news, company profile websites, and all types of “static” WordPress sites, all WordPress pages can be fully cached and served faster, excluding WordPress admin pages, which are not cached for obvious for reasons.

For e-commerce, membership, forum, and all types of “dynamic” WordPress sites, most WordPress pages can be fully cached and served faster, except some pages those should stay dynamic.

For example, in the case of WooCommerce, the homepage, shop page, and single product page can be fully cached, but cart, checkout, and my account pages should be excluded. For these dynamic pages, you can use Redis Object Cache to reduce your MySQL database load and make your dynamic pages load faster, but you do not want to cache these pages fully as the latest changes will not be seen

Đánh giá wp fasted cache nginx năm 2024

How To Install Nginx FastCGI Cache (RunCache) Using RunCloud Hub

RunCloud Hub is a hub for all RunCloud plugins for WordPress. It is not only for Nginx FastCGI Cache (RunCache), but also Redis Object Cache and Server Health & Transfer Stats monitoring directly from your WordPress dashboard.

If you want to use Nginx FastCGI Cache (RunCache) to speed up your WordPress website, then RunCloud Hub is the perfect choice for you.

You can read the complete guide on how to install RunCloud Hub here.

Once you have installed the RunCloud Hub plugin, Nginx FastCGI Cache (RunCache) is automatically installed and enabled in your WordPress website, no complex process required.

Đánh giá wp fasted cache nginx năm 2024

How To Check If Nginx FastCGI Cache (RunCache) Works

When using any cache WordPress plugin, usually you can check if your WordPress page has been cached by checking the footprint at the end of your web page source code.

Nginx FastCGI Cache (RunCache) works on the server-side, which means there is no footprint on your web page, you need to check the headers of your website to see these possible values of x-runcloud-cache.

  • HIT : Page is cached and served from the cache.
  • MISS : Page is served dynamically from the server, not from the cache. The response might then have been cached. Refreshing this page again should change the header from MISS to HIT or BYPASS.
  • BYPASS : Page is served dynamically from the server, not from the cache. It is excluded from cache, for example WordPress dashboard admin pages or WooCommerce cart/checkout pages.
  • STALE : Page is served from the cache in cache directory.
  • EXPIRED : Cache is expired. Page is served dynamically from server.

There are many ways to check the headers of your website, for example:

KeyCDN Performance Test is a free online web performance test to test your website from 10+ test location, from United States to Asia areas.

You can use this tools to evaluate TTFB (Time to first byte) of your website from many locations.

Using this tool, you can also check the response header to see if this web page is served by Nginx FastCGI Cache (RunCache).

Đánh giá wp fasted cache nginx năm 2024

You can also view the response HTTP headers in Google Chrome by following these steps:

  1. In Chrome, visit your web page, and open Web Developer Tools by pressing F12 or right click and select Inspect.
  2. When opened, click and select the “Network” tab.
  3. Refresh the page to get fresh page data.
  4. Select the top HTTP request on the left panel and observe HTTP headers on the right panel.

Đánh giá wp fasted cache nginx năm 2024

If you are familiar with linux command, you can use cURL to check HTTP headers quickly.

curl -I http://yourdomain

Đánh giá wp fasted cache nginx năm 2024

Performance Benchmark : Handling More Traffics

By eliminating PHP-FPM and MariaDB/MySQL when serving your WordPress page from Nginx FastCGI Cache, the huge benefit is your server can handle more traffics with the same server specifications.

For this test, we use DigitalOcean 1GB RAM ($5) and default WordPress installation using Twenty Nineteen WordPress Theme.

We use two different tools:

  • Loader.io – load testing
  • New Relic Infrastucture – CPU usage monitoring

First Test – 25 users per second in 1 minute

Without Nginx FastCGI Cache (RunCache), average response time is 201 ms.

Đánh giá wp fasted cache nginx năm 2024

With Nginx FastCGI Cache (RunCache), average response time is only 9 ms. It is big improvement!

Đánh giá wp fasted cache nginx năm 2024

Without Nginx FastCGI Cache (RunCache), the CPU usage jump to 50%.

Đánh giá wp fasted cache nginx năm 2024

With Nginx FastCGI Cache (RunCache), the CPU usage is very low.

Đánh giá wp fasted cache nginx năm 2024

Second Test – from 0 to 100 users in 1 minute

For this test we use Loader.io to send from 0 concurrent user and increasing to 100 concurrent users within 1 minute.

Đánh giá wp fasted cache nginx năm 2024

Without Nginx FastCGI Cache (RunCache), average response time is 1071 ms. You can see that as concurrent users increase, the response time increase also. Your website will be slow when you have more visitors.

With Nginx FastCGI Cache (RunCache), the average response time is still low, 14 ms, increasing visitors from 0 to 100 users doesn’t affect too much on the response time.

Đánh giá wp fasted cache nginx năm 2024

Exploring RunCache Features

Using RunCloud Hub WordPress plugin, you will have more controls on how Nginx FastCGI Cache (RunCache) works in your WordPress website.

RunCache Purger

Purger settings allow you to have more control when the cache is cleared, for example:

  • Automatically clean cache of homepage when post is edited or has a new post.
  • Automatically clean cache of homepage when post removed.
  • Automatically clean cache of post/page/CPT when published.
  • Automatically clean cache of post/page/CPT when comment approved and published.
  • Automatically clean cache of post/page/CPT when comment removed.

Đánh giá wp fasted cache nginx năm 2024

RunCache Rules / Exclusion

Rules settings allow you to control Cache Exclusion.

Exclude URL Path option allows you to exclude cache based on matching URL Path. This is very useful when you have dynamic pages that should not be cached in your website.

For example, in WooCommerce, you have the Cart, Checkout, and My Account page that must never be cached. For WooCommerce users, no action needed, these pages have been added by default.

Đánh giá wp fasted cache nginx năm 2024

Exclude Cookie option allows you to exclude cache based on matching Cookie name.

Exclude Browser option allows you to exclude cache based on matching Browser User-Agent.

Exclude Visitor IP option allows you to exclude cache based on matching Visitor IP Address.

RunCache also has dedicated settings for query strings, because query strings will not cache by default.

Allow Cache Query String option make it possible for you to allow cache based on matching query string, for example UTM parameters (utm_source, utm_medium, utm_campaign), fbclid, gclid, etc.

Exclude Cache Query String option allows you to exclude cache based on matching Query string.

Đánh giá wp fasted cache nginx năm 2024

RunCache Preload

Preload settings allow you to generate caches of your pages without having to wait for a user to visit your pages. Normally, cache is generated after a user visits a page.

You have the options to:

  • Preload caches automatically when any purge action was triggered.
  • Preload caches automatically based on schedule time (day/week/month).
  • Preload caches manually by clicking “Run Cache Preload” link.

If you have big number of posts / pages / products in your WordPress sites, cache preload process somestimes can consume your server CPU resources. It is better to run cache preload manually for this case.

Đánh giá wp fasted cache nginx năm 2024

Short answer, YES!

The important thing to understand, Nginx FastCGI Cache (RunCache) works on the server level and popular WordPress cache / optimization plugins work on the WordPress/application level.

They are in different spaces and it should be compatible.

When you use both page caching feature from RunCache and your favourite cache plugin, it is possible if Nginx FastCGI Cache (RunCache) stores the caches from generated caches of the cache plugin, it doubles the page cache.

You can choose to disable the page cache feature from your WordPress cache / optimization plugins if you find any issue with RunCache.

For page cache use cases, RunCache should be faster because once your website page cache is available, it will be served to your visitor directly from your server without WordPress.

If you do not want to use any cache plugin and fully use RunCache, you can still use any optimization plugin, for example Autoptimize, to minify HTML, CSS, and Javascript files in your website.

Summary

In RunCloud, we provide you with full control over your server. That is why we do not apply any server-side caching mechanisms automatically to your server.

If you want to apply server-side caching to one of your web applications within your server, then RunCache (RunCloud Hub) is your answer.

RunCache allow you to utilize Nginx FastCGI Cache to speed up your WordPress performance without having to deal with linux command to setup Nginx FastCGI Cache.

All paid plan users (Basic, Pro, Business) can enjoy the full functionality of this feature.

It has been a largely requested feature that we knew would be useful to you and we are very excited to bring this feature to RunCloud. Never ever hesitate to suggest new features that you want to see, and we will make it happen.