Instructions to Fix Error "Leverage Browser Caching" PageSpeed ​​Insights Google

October 1, 2022 25hotness 0likes 0comments


When you use Google's PageSpeed ​​Insights tool, you must have encountered Leverage browser caching error, maybe it's js, css, html or your image is not cached (on the server's hard drive). Let's fix this error with Hostagy!

How to handle Leverage browser caching error

Let's add a piece of code to the .htaccess file so that the browser caches these files to the hard drive, then the error "Leverage browser caching" will disappear and point PageSpeed Your website will increase rapidly

Leverage browser caching

Code snippet:

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##

PageSpeed Insights

Try to check the Speed ​​page again: https://developers.google.com/speed/pagespeed/insights/

Best Domain - Hosting - VPS Provider in Vietnam

As a unit in the top 3 in the field of website hosting services in Vietnam, Hosting Vietnam is considered as the place with cheap hosting and always receive many recommendations from the computer forum about where to buy a good host. From only 40,000 VND/month, users have immediately got themselves a host to freely study, research or run a demo website… Besides, Hosting Viet is also a pioneer in cloud computing technology. cloud hosting), package server rental with unlimited bandwidth.
Hosting Vietnam has a variety of service packages, besides super cheap packages of 40,000 VND/month, the provider also has cheap vps quality for many different business groups. These packages always meet the storage needs, accessing tens of thousands of people every day.
In addition, with professional customer care service, a team of highly qualified technicians will quickly support and handle arising problems. From there, helping users get a smooth and enjoyable experience.
Thus, through the article on Hosting Viet has helped you get more useful information! Hope you will be able to equip yourself with many more knowledge that we have shared! If you find this article useful, please subscribe to follow the latest information from Hosting Viet. Good luck!





Source link

hostadmin

This person is a lazy dog and has left nothing

Comments