How to Clear the Server Cache or Nginx Cache

How to Clear the Server Cache or Nginx Cache

What is Server Cache?

The server here uses a caching engine called Nginx. Nginx sets in between the client (your browser) and the webserver. It generates a cached copy of your web page for faster viewing and faster performance of your website. When a browser makes the request to the server for your webpage, Nginx serves the cached copy of your website content instead of contacting the server and streaming the data directly from the server. This saves time and free’s up more resources on the server so your website performs faster and more efficiently. There are times when you may need to clear this cache during troubleshooting or when making changes to your website pages. In this article, we will discuss How to Clear the Server Cache or Nginx Cache.

In this article: Clear HomePage Cache Clear One Page Cache Clear Cache for ALL Domains Disable Server Cache

 

See Also: Clear Browser Cache
 

How to Clear the Server Cache

If you’ve made a bunch of changes to your website, pages or posts, you may need to clear the server cache so the new version of your website can be served instead of the outdated cached copy. In this event, you can clear the server cache for your website using Cache Manager in cPanel. To do so, follow the steps below.

 

Step 1. Login to cPanel

Step 2. Scroll down to the Software section or type cache into the search bar. Then Click on ‘Cache Manager‘  

how to clear server cache

 

 

Clear the Cache for the Home Page

You can clear the Nginx Cache for your Home page easily. 

Step 1. Use the domain selector to select the domain you want to clear the cache for.

clear nginx cache 

 

Step 2. Click on the ‘Purge‘ button next to your domain leaving the URL field blank.

 

 

Clear the Cache for a Specific URL

If you have recently made changes to a specific page or post on your Website you may need to clear the cache for that page. You can clear the cache for a specific URL easily. 

Step 1. Use the domain selector to select the domain you want to clear the cache for.

clear nginx cache 

Step 2. Enter the end of the URL for the page you wish to clear the cache for in the empty field. Then click ‘Purge‘.

clear cache for a specific url

 

 

Clear Cache for All Domains

Sometimes you may need to clear the server cache for ALL of your domains. We do not recommend using this setting very often as it clears all of the cache stored for ALL of your domains in cPanel which can cause a spike in resource usage until Nginx is done rebuilding the cache especially for sites expecting a lot of traffic. But you can use it when needed and it’s generally okay to use from time to time. 

Step 1. To clear cache for all of your domains in cPanel, click on the ‘Purge Full Cache‘ button.

clear cache for all domains in cpanel

 

 

Temporarily Disable Cache Before Making a lot of Changes

You can disable the cache engine for your website temporarily when needed if you intend to make a lot of site-wide changes to your website or need to do some troubleshooting. 

Step 1. Login to cPanel

Step 2. Scroll down to the Software section or type cache into the search bar. Then Click on ‘Cache Manager‘  

how to clear server cache

Step 3. Use the domain selector to select the domain you want to disable the cache engine for.

clear nginx cache 

Step 4. Click on the ‘Options‘ tab. Underneath the ‘Enable Caching‘ section, select ‘No‘.

disable server cache 

Step 5. Scroll down to the bottom of the page then click the ‘Save Changes‘ button.

clear server cache

 

Don’t forget to re-enable the cache once you are done making your changes. You can enable the cache for your domain by following the same steps and selecting ‘Yes‘ instead of no under the ‘Enable Caching‘ options.

How useful was this post?

Let us know what you think!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

Thanks for rating our post!

Don't forget to follow us on Facebook for more great tips. https://www.facebook.com/glowfrog

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Share this Article