Enable, Disable and Clear Nginx Cache

Nginx pronounced Engine X is now enabled by default for all packages as a reverse proxy cache. The benefits of this type of caching are visible through an increase in the general speed and availability of your sites via caching. This works by saving a copy of site content, then returning this copy to the user directly. Removing the need to request and generate the content from the origin server every time a user visits a site. This is a much more efficient way of handling requests, especially on busy sites.

On occasion, caching will need to be disabled or cleared. A great example is during the active development of a site. You might need changes to appear immediately, because of how caching works it might be best to disable the cache entirely for the duration of development.

This guide outlines how to do this from your cPanel control panel, so you must first log in to cPanel.

Enable Nginx Cache in cPanel

1. First off, from the main cPanel overview screen, navigate to the general information panel.

Nginx panel in cPanel
Nginx panel in cPanel

2. To enable the cache, click the highlighted radio button and a small spinning icon will appear.

Enable Nginx in cPanel

3. Caching is active when the button appears blue and “Active” appears.

Nginx showing active

Disable Nginx Cache in cPanel

1. To disable caching, click the highlighted button below, the loading icon indicates it is working.

Disable nginx

2. Caching is disabled when the button appears clear and the text “Inactive” appears. It will also remove the “Clear Cache” button.

Clear Nginx Cache in cPanel

1. Clearing the cache is simple, just click the “Clear Cache” button as indicated below. If the cache clean-up is successful, a green banner will appear above.

Clear Nginx Cache