One easy way to improve your wordpress blog loading speed is to use browser caching and you can do this without having to install any plugin – just a few additional changes on your .htaccess!

WHAT IS THE PURPOSE OF BROWSER CACHING?

Each time the browser loads your page, it has to download all the files to display your site properly – html, css, javascripts, images, etc.

Browser caching helps speed up loading of site by storing some of these files (mentioned above) locally in to the user’s browser (as temp files). First time the visitor loads a site, it might be a little slow but after site has loaded, when user revisits your site and/or refreshes the page, it will load a lot faster because your browser will use the temporary stored files (html, css, images, javascripts, etc) to display your site.

HOW TO LEVERAGE BROWSER CACHING : 

Paste the following to your .htaccess located at the root of your server.

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

You can set different expiry dates depending on how frequent your update your files (html, images, javascripts, etc)

GTMETRICS.COM recommends :

  • Be aggressive with your caching for all static resources
  • Expiry at a minimum of one month (recommended: access plus 1 year)
  • Don’t set your caching more than a year in advance!
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s