How do I turn on/off browser cache for images, CSS and JS?
Added: 19.01.2017 11:30:16 Last updated: 19.01.2017 12:18:02
Browser cache is used to hold images, CSS and JS files locally on your computer so the files does not download from the server each time you reload the website in your browser. If any of the files are updated on the server, the server will tell the browser about the change and the browser will download a fresh version of the file.
Default caching time is normally set to 604800 seconds (7 days) on our servers.
It is also possible to get fresh content from the server if there are changes made on the files and they are not showing by using the following combinations on the keyboard:
Windows: Ctrl + F5
Mac/Apple: Command + R
It is possible to change the settings using a .htaccess file:
Another example if you want to disable browser cache in visitors browsers. Then you can add this in .htaccess file:
The downside to disable browser cache is that all the files are loaded directly from server each time the visitor reload the website is that it will use more resources and cause website to be slower.