Speed up website: Set HTTP Expires header
filed in QuickFix, Technical, linux on Nov.20, 2008
When I see my website loading very slow, I get irritated as I want that to load fast on any type of Internet connection. Because, I’m trying to reach out to all…
Step by Step take action on website optimization and speed up your website. All it takes is the hacking mentality which lets you digg out lots of things from the world of Internet.
One simple way to improve the performance of your website is to set up HTTP Expires headers for static content well into the future. For example,Images, CSS files, PDF’s. This forces your clients browser to cache them and make your website load fast.
If your website is running on Apache web server, put the following lines of code into .htaccess or Apache configuration file and you’re done with it. It works if you have mod_expires module enabled in your web server.
ExpiresActive On
<FilesMatch “\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$”>
Header set Expires “Thu, 15 Apr 2010 20:00:00 GMT”
</FilesMatch>
Here is an another interesting website which I found on the net while studying about mod_expires.


November 21st, 2008 on 10:18 am
Interesting…
When i used YSlow plugin in Firefox, it was giving suggestion like “expires header is not set for static contents”. But i was confused that how i can add header to images, Css etc…
Now i got the answer
November 21st, 2008 on 11:29 am
Aravinda,
I wanted to write about Firebug and YSlow before writing about this
.
Yeah there are lot many tweaks which we can add to optimize the website performance. My page is loading faster now.
June 19th, 2009 on 10:33 pm
Thats what I was looking for.
Even My newly installed blog loads slow and yslow advised me to use mod_expire and mod_header.
Can you please tell me the difference and also advise what will be better to use?
June 20th, 2009 on 8:52 am
Sure Abhishek.. Will try to write about it soon..