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.

## EXPIRES CACHING ##

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”


## EXPIRES CACHING ##

[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.

HOW TO: Setup Google Analytics To Check Site Speed

Google Analytics quite recently added a new feature for checking your site speed and page loading time, awesome isn’t it? It is not an automatic upgrade, so you need to tweak your Google Analytics default tracking code to enable this feature. Now it will be easy to improve your site’s loading speed.

Site Speed Google Analytics

Add Site Speed Code in Google Analytics

To get the new site speed report, add the following line to your analytics code

_gaq.push([‘_trackPageLoadTime’]);

Now this is how your code will look like this [sample code] :

<script type=”text/javascript”>
var _gaq = _gaq || [];
_gaq.push([‘_setAccount’, ‘UA-XXXXX-X’]);
_gaq.push([‘_trackPageview’]);
_gaq.push([‘_trackPageLoadTime’]);
(function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();
</script>

This will be really useful for webmasters and bloggers to detect which landing pages are slow. Also you can find the cause and fix it earlier since Google considers site loading speed as a key factor in SERPs.

Google Search Rankings Considers Site Speed

Google Webmaster ToolsGoogle officially announced that they are now considering the loading speed of a site in search rankings. Site speed reflects how quickly a website responds to web requests.

Post excerpts from Official Google Webmaster Central Blog,

While site speed is a new signal, it doesn’t carry as much weight as the relevance of a page. Currently, fewer than 1% of search queries are affected by the site speed signal in our implementation and the signal for site speed only applies for visitors searching in English on Google.com at this point.

MUST READ : 20+ Tips To Improve Your Blog’s Loading Speed

In the above mentioned article I provided 20+ tips to improve and increase your site’s loading speed, which includes many tools too.

Search Rankings
Optimize Site's Speed To Get Good Place

You can also try Site performance feature of Google Webmaster Tools. This shows you performance statistics of your site. You can use this information to improve the speed of your site and create a faster experience for your users. I think now it’s time to consider your site’s speed. I need to tweak my blog too… 😀