Site Optimization

Optimizing Site – Caching – Part 2

In continuation to the topic http://blog.lysender.com/2009/02/optimizing-site-caching-files/ I noticed that my header did not reflect the max-age setting on .htaccess file. Thus, I need to change another technique, or another code.

I’ve found http://www.websecurity.mobi/wordpress/913-expires-header.html and tried their suggestion. It uses the same max-age syntax but sets cache control public, and with filename matching to I don’t have to use several blocks of code for each file type.

This is the .htaccess code:

<FilesMatch “\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$” >
Header set Cache-Control “max-age=290304000, public”
</FilesMatch>

And surprisingly, my rating for performance goes to grade C on YSlow.

That’s great indeed!

Leave a reply

Your email address will not be published. Required fields are marked *