views:

16

answers:

1

Thanks in advance for your help.

I've been experimenting with YSlow and Google page speed, both provide very helpful advice and neither seems to have an advantage over the other but when it comes to Entity tags they seem to disagree or conflict in some way. The following code satisfies YSlows 'Configure entity tags (ETags)' pointer

Header unset ETag
FileETag None
<FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header unset Last-Modified
Header set Expires "Fri, 21 Dec 2050 00:00:00 GMT"
Header set Cache-Control "public, no-transform"
</FilesMatch>

However with this code in place Google Page Speed provides the following advice 'specify a cache validator'. Another member Aularon suggests using this code to satisfy Google's requirement

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 year"
</IfModule>

Both work separately, but neither solution satisfies both validators, so my questions are.

  1. Should I care?
  2. Is there a good solution for both validators?
  3. Does either solution really have a major impact?
+1  A: 
  1. Yes
  2. As Yi Jiang pointed out, these are not validators. These are tools to help you evaluate the performance of your page. You need to consider their recommendations. However, setting something like the Expires Header doesn't necessarily mean the user agent will honor that. Personally, I've seen the YSlow add-on in Firebug not list certain resources as having their Header set even though I have. The point is consider output from both tools, but I wouldn't beat yourself up over trying to make both happy.
  3. Of course. Your first expires code set's all graphical resources to not expire for the next 40 years. That would have a huge impact on download times for return visitors. As well as site maintenance - i.e. ensuring to invalidate the cache as the site changes. Your second rule caches everything for a year. That would have very serious impact on your site - e.g. caching all your resources, including html pages!
Jason McCreary