How do I disable the server RAM cache during website development?

The web servers are installed with a RAM cache to help speed up your website.

The caching software will serve static objects from cache with a 60 minute timeout and dynamic objects with a 20 second timeout before rechecking the website.  This means if you are actively updating the site, you may not see the changes straight away.

As such, during active development you may wish to temporarily disable the server's caching software software. This can be done by adding the following anywhere in your website's main .htaccess file:

<FilesMatch "\.(html|htm|php|css|png|jpeg|jpg|js)">
    <IfModule mod_headers.c>
        Header set no-cache "1"
        Header set Set-Cookie "NO_CACHE=1; path=/;"
    </IfModule>
</FilesMatch>

  • Email, SSL
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I enable PHP error logging?

To enable PHP error logging, simply add the following lines to your website's main .htaccess...

How do I enable PHP short tags?

PHP short tags description from the official PHP documentation: When PHP parses a file, it looks...

How to set core PHP directives (e.g. upload_max_filesize)

Some PHP scripts may require settings different from the defaults configured in the server's...