A web browser need to retrieve many resources from server (i.e. HTML files, CSS file, JS files, text, images etc.) in order to load a website. Web Cache is the technology used in web browsers and software applications to ‘temporally store’ or ‘remember’ visited web page resources on local disc. This temporarily stored data is called ‘ Web Cache’ or ‘HTTP Cache‘ And when you visit the same website or webpage again. This time web browser downloads only updated content from website and combines it with ‘temporally stored’ data of that same website. Due to this web cache help to reduce bandwidth usages, server loads etc. Therefore, Leverage Browser Caching became important to load your web pages faster.
Where I can enable this feature?
It’s basically an Apache module and this should be enabled by adding specific code to the Apache configuration file. Most of the users have only user level access to the server. That’s the important of this post. Here I’m listing a code which can be added to the .htaccess file to enable this feature. The .htaccess is located in the public folder of your website.
Here is the code to add:
By using above code, the main static contents such as images, CSS, PDF’s, JS, etc will be cached in web browser in order to produce faster loading times in the future.
That’s it 🙂