1. Home
  2. Web Hosting
  3. Wordpress+
  4. Optimizing WordPress with NGINX

Optimizing WordPress with NGINX

Our solution runs on the NGINX cache server. It is an HTTPS cache server, deployed as a reverse proxy between application servers and clients. It allows to unload the first ones by caching their data, according to rules defined by the system administrator and the developers of the site, to serve the requests more quickly, while lightening the load of the servers.

NGINX allows you to cache your pages and articles, thus accelerating their display. In most cases, the NGINX cache runs correctly but sometimes it refuses to cache. Indeed, the Nginx cache is very obedient, so if one of your plugins or even your theme gives it an instruction like no cache then it will not be carried out.

Check that the nginx cache is working on your site

This consists in checking that your site is well cached. To do this, we will use a very simple tool: https://tools.pingdom.com

If your site is cached in NGINX, you will see HITand MISS if it is not the case.

The tool Pingdom Tools will give you more information about the performance of your WordPress.

Go to the website http://tools.pingdom.com/fpt/. Enter theURL of your site then click on the drop-down menu Test from and choose a server in Europe. Run the test by clicking on the green button Start Test.

The NGINX cache is active if you see the information X-Cache-Status in the details of the analysis.

The NGINX cache is NOT active if the loading time is too long or if on the scan details you do not see the information at all X-Cache-Status.

Activate the NGINX cache if it is inactive

The easiest solution is to use a disk cache plugin that will force this caching. You can do this with two plugins:

W3 Total Cache (free) and WP-Rocket (premium).

Attention

If you are still using a temporary URL rather than your domain name, the NGINX cace is not activated on it so as not to disrupt your WordPress site development and implementation before the final domain name pointing.

How to use W3 Total Cache

In your WordPress menu, go to Extensions, search for W3 Total Cache and install it.

Activate W3 Total Cache.

Once the plugin is installed, you have a new menu in your WordPress named Performance. Click on it to go to General settings.

Fill in the following options.

Enable Page Cache

Enable Browser Cache

Activate Reverse Proxy by entering the NGINX IP. Here is the IP of your cache: 212.129.21.7.
To view your IP, you must be logged in.

Within the panel Performanceclick on Page caching.

Enter the pages you do not want to cache.

Save with the button Save all settings.

Clear all caches by clicking on Purge All Caches.

ATTENTION

These are the only settings you need to activate. Otherwise you may encounter errors!

The operation is finished, you just have to retest your site with Pingdom Tools and check that your site finally benefits from the NGINX cache. Don't hesitate to test it twice so that the NGINX cache can load.

If you encounter any difficulties, do not hesitate to ask us for advice through a support ticket.

How to use WP Rocket

If you already have a WP Rocket license, just install the latest version. Be sure to disable any other caching plugins first, then proceed with the following settings.

Enable the following options: LazyLoad, HTML optimization and Google Fonts. CSS and JS options can sometimes be problematic depending on your theme or plugins, but try them for best performance.

In the advanced options of WP Rocket, don't forget to add the pages you never want to cache. By default the "cart" and "order" pages are automatically excluded from the cache for WooCommerce, Easy Digital Download, iThemes Exchange, Jigoshop & WP-Shop.

If you use our WPS Hide Login plugin, don't forget to specify it in the pages to exclude from the cache.

The operation is finished, you just have to retest your site with Pingdom Tools and check that your site finally benefits from the NGINX cache. Don't hesitate to test it twice so that the NGINX cache can load.

If you encounter any difficulties, do not hesitate to ask us for advice through a support ticket.

Updated on 28 September 2022

Related Articles