A quick and easy way to prevent specific resources to be cached by sending the correct headers in .htaccess file.

For example, in the code below, we want that our htmls, js and css won’t be cached. This can be useful when you’re developing a site and want everything to refresh when you reload the page.

Those headers also come in useful when your site is behind a proxy, such as CloudFlare, and have little control on what gets cached and what not.

Put this code below in your .htaccess file (and of course change or add other files types)




Leave a comment