4

Resolving YSlow’s “Add Expires headers” Low Grade

posted on August 05, 2010 17:41 PM by Jhoy Imperial
under PHP, Tips, Web development

Speed up the loading of your site by caching web site files like images, CSS and javascript files. First time visitors of your site will gonna be making several HTTP requests. The more HTTP requests, the slower your site will load.

I found a good website speed tip that would help make those frequently requested files cacheable.

Using .htaccess you can add the following code add expire headers to your files:

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Thu, 15 Apr 2011 20:00:00 GMT"
</FilesMatch>

NOTE: Backup your .htaccess file first before modifying it.

Now your site will load up a little bit faster.

;)

<FilesMatch “\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$”>

Recent Tweets

Sponsored Links

Recent Comments

 

"Minimalist Cereal 2"
design and theme by Jhoy Imperial

Email us at support@codingcereal.com

Copyright 2010 - 2011 © www.codingcereal.com