Table of Contents
Basically, all the files your site uses (jpgs, gifs, css, js, etc) need to be able to tell visitors computer how long they should keep them for before checking for a new file. This is called web browser caching. If we don’t specify the browser a “cache time” then it will get a new copy of the file every time they visit the site which means more bandwidth usage and increases your page load speeds.
Google Page Speed recommends that files are cached at least a month. If you don’t make many changes, set it to at least a month. However, if you make changes to your site or are still working on developing the site, you may want to set your JS and CSS files to something lower such as 24 hours. However, in the example below we have set the caching of all files to 5 weeks.
To leverage web caching you will have to add some lines of code to your .htaccess file in the root folder of your OpenCart installation.
If you need further assistance please feel free to ask a question on our support center.
Is this code still okay for opencart 2.1
These should work as they are standard web browser cache controls.
Hello guys,
Does this code work on opencart 2.1 also.
Thanks