Rails 3.1 on Apache, PageSpeed says "Specify Cache Validator" when using Asset Pipeline apache config Rails 3.1 on Apache, PageSpeed says "Specify Cache Validator" when using Asset Pipeline apache config apache apache

Rails 3.1 on Apache, PageSpeed says "Specify Cache Validator" when using Asset Pipeline apache config


That code was cut and pasted from the original Rails helper code for reasons of consistency. (It was me that copied it).

I have checked with Steve Souders (thanks, Steve) on this, and he said the following:

You should not unset Last-Modified. I'm betting the person who wrote that was click "Reload" to do their testing. When you click "Reload" you're explicitly telling the browser to send a conditional GET. (see this)

ETag has the same issue (if you hit "Reload" it'll send a conditional GET). But it has a different issue that probably means you should unset ETag. The issue is that the default ETag syntax on Apache and IIS is causes unnecessary validation failures and wasted bytes transferred. You should either configure the syntax to workaround these problems, but most people find it easier to just unset ETags. (see this)

I'll get the Rails docs updated!