×

Improve YSlow Score With .htaccess

warpspeed

Published: 2009-12-20

How fast your site loads is a huge factor in how many visits you get. One of the biggest names in performance testing is YSlow. A high score on YSlow is a good indicator that your site is performing well. Many of the scores can be improved with a little bit of tweaking to your .htaccess file.

Add this snippet to the top of your .htaccess file.

Now for a little breakdown of what each part does.

This part disables E-Tags so not to cause conflicts.

This gzips your css and javascript files resulting in a smaller transfer size.

This adds a far future Expires header to most static files you will have.

With these few changes your score in YSlow should dramatically improve. Any other .htacces tricks? Let me know in the comments.