Leverage Browser Caching To Improve Site Speed

The phrase “Leverage Browser Caching” actually means that different items on your site should have different expire times set. This is recommended by Google, and it will improve your overall Google Page Speed Score. If you have installed W3 Total Cache then you can check your site’s Page Speed score on your dashboard itself. We have shared lots of tips to improve website loading speed, and this is one of the simplest one.

Loading Time

Some tips to tweak your site’s speed

  • Use PHP Flush To Improve Site Loading Speed
  • HOW TO: Setup Google Analytics To Check Site Speed
  • HOW TO: Get Google Page Speed Report Via W3 Total Cache
  • 7 Free Best Tools To Check Website Loading Speed

How to Leverage Browser Caching

Find your .htaccess file, open it with any text editor (Notepad for instance) and add these codes below. Then save it.


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 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 2 days”


[Code Updated. If you still get an error, check this post]

What This Code Actually Does?

It will instruct the browser to cache different static resources like images, flash, PDF, JavaScript and icons for some specified period of time. You can also increase or decrease the values depending on your specific requirements. By configuring your web server to set caching headers for cacheable static resources, your site will appear to load much faster.

Do you know any other simple tips to improve site loading speed? Kindly share them in comments below.