How To set Up non-cached Pages With .htaccess

How to set up Non cached Pages With .htaccess

Cache maybe helpful at times in reviewal of recent information incase your machine may have closed before you save your data. However, there are times you may not need this data stored in case you prefer seeing your fresh page after you perform a reload. With a cache-control its easy to define the manner of storing a cache as well as how long it should be kept. If the cache is set to clear after 5 minutes then after that time no retrieval of that link or page will be there. Its better using a sub-domain to perform cache in your browser with .htaccess because not all files must be cleared

How to set up a non-cache page with .htaccess;

  • Login to cpanel-click on file manager on the section under files
  • Open .htaccess
  • The following code should be set on .htaccess (<filesMatch “\.(html|htm|js|css)$”>FileETag None<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store,
must-revalidate"
Headerset Pragma "no-cache"
Headerset Expires "Tue, 13 Nov 2017 04:00:00 GMT"
</ifModule>           
</filesMatch>)”

The page is set to no cache nor store

 

Was this article helpful?

Related Articles

Leave A Comment?