Still talking about improving page speed for website/ blog, previously I wrote about Leverage Browser Cache on .htacces and to make our blog load faster and faster we can add and set future expire header in .htacces or optionally in html meta tags. The principal differences of both are, Leverage Browser Cache only tells the browser to recollect the cached files while setting future expire header (Expire Caching) tells how long the files should be cached. For static files such as images, css' and javascripts that relatively unchanged we can instruct the browser not to download the same file in the future. The longer future expire cache is set, the better you get.
Adding Expire Header (Expire Caching) can be done easily in two ways, by adding it on .htaccess and optionally set the meta tag or cache control in html header.
I set the default future expires cache in 29 days or a month. This parameter can be changed as long as you need. For active sites that relatively dynamic, you may set to shorter period but if you are sure your files are really static, then the longer the better.
Minify HTML, Javascript and CSS without Plugin
Related Post by Tags and Category Without Plugin
Automatic Post Excerpt (Teaser) without Plugin
Add Expire Header in .htaccess
To define how long the static files should be cached, you can add the following codes to .htacces file on your site root:## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive OnExpiresByType 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 29 days"
</IfModule>
## EXPIRES CACHING ##
I set the default future expires cache in 29 days or a month. This parameter can be changed as long as you need. For active sites that relatively dynamic, you may set to shorter period but if you are sure your files are really static, then the longer the better.
Set Future Expire Caching in hmtl Meta Tags
You can set the Future Expire Caching in hmtl Meta Tags manually and need to update for certain time. But for some sites, this way is more effective and applicable. Add the following codes and define the parameter to your need:<meta http-equiv="expires" content="tue, 01 jan 2013 19:30:00 GMT">Another ways to improve your site perfomance, please read also the following posts:
Minify HTML, Javascript and CSS without Plugin
Related Post by Tags and Category Without Plugin
Automatic Post Excerpt (Teaser) without Plugin