How to set leverage browser caching cpanel
In your .htaccess file you can paste the following directives at the top of the file:
By using this code, our main static files like images, CSS, JS, PDF’s etc. will be cached in order to produce faster loading times in the future.
You can see in the above code that there are time periods like “1 year” or “1 month”. These are associated with file types, as an example the above code states that a css file should be cached for a month. If you want to change that and say you want them only cached for a year you would simply replace “1 month” with “1 year”. The values above are pretty optimized for most webpages and blogs.
<FilesMatch "\.(ico|pdf|jpg|jpeg|png|gif|html|htm|xml|txt|xsl)$"> Header set Cache-Control "max-age=29030400" </FilesMatch>
you have set all files (PDF, image, webpage, etc) to expire in peoples’ browsers after 1 year.
It is easy to leverage browser caching in TYPO3 and other CMS with this tutorial.
That’s it for leveraging browser caching with your .htaccess file!
I hope it will help you lot.. Best Luck 🙂
If you have any queries, please do not hesitate to contact me at Jainish Senjaliya