How To Disable Nginx Caching


  • Click Login to cPanel under the Actions Menu

  • Navigate to the Files section and click on File Manager

  • Click the Settings icon located on the upper right hand corner of the page

  • Select Show Hidden Files (dotfiles) and click Save

  • Navigate to the folder for your website
    Note: for this example we will assume that your website is under public_html
  • Right-click the file named .htaccess and select Code Edit

  • Click Edit in the Code Editor dialog box

  • Add the following code in the text field provided:
    <FilesMatch "\.(html|htm|js|css|php)>
    FileETag None
    Header unset ETag
    Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "Fri, 13 Feb 1976 06:00:00 GMT"
    </FilesMatch>
  • Click Save Changes

Caching for your website is now disabled.  You will need to add the code above for every folder that needs caching disabled.  To re-enable caching, you can delete the code or add a pound sign(#) in front of every line.


¿Le ha resultado útil este artículo?



  • Set Up URL Masking On Your Site

    At times, you may have a site created in a different location or directory and don’t want your visitors to see the full path to your files. Fort...

  • How to Redirect HTTP Requests to HTTPS

    Below we are going to show you how to redirect all non-https request to use https. Why would you do this? This depends on what kind of site you are ho...

  • Current Loaded Modules

    Below we have listed the Apache modules that are loaded on all of our services. Updated February 24th/2015 actions_module alias_module asis_module ...

  • Error Messages Overview

    Error 400: Bad RequestError 401: Authorization RequiredError 403: ForbiddenError 404: Page Not FoundError 405: Method Not AllowedError 406: Not Accept...

  • How to set your domain to redirect to WWW by default

    Add the below to your .htaccess file in order to have your-domain redirect to www.your-domain. Just make sure where it says “your-domain.comR...