my php-generated thumbnail files and combined javascript and css files (all having their expiration dates anc cache=public set etc) return the full content sometimes, other times they load from proxy cache!
This is the comment that redbot.org gives, sometimes:
An If-Modified-Since conditional request returned the full content unchanged.
*HTTP allows clients to make conditional requests to see if a copy that they hold is still valid. Since this response has a Last-Modified header, clients should be able to use an If-Modified-Since request header for validation. RED has done this and found that the resource sends a full response even though it hadn't changed, indicating that it doesn't support Last-Modified validation.**
the PHP thumbnail generator header
header ("Content-type: image/jpeg");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s", time() - 404800000)." GMT");
header ("Expires: " . gmdate("D, d M Y H:i:s", time() + 2419200) . " GMT");
header ("Cache-Control: public, max-age=2419200");
htaccess
<IfModule mod_headers.c>
ExpiresActive On
ExpiresDefault M172800
##### DEFAULT EXPIRES
<FilesMatch "\\.(ico|jpg|png|gif|svg|swf|css|js|fon|xml|pdf|flv)$">
ExpiresDefault M1209600
Header set Cache-Control "max-age=1209600, public"
</FilesMatch>
##### DYNAMIC PAGES
<FilesMatch "\\.(php|cgi|pl)$">
ExpiresDefault M7200
Header set Cache-Control "public, max-age=7200"
</FilesMatch>
Header unset Pragma
Header unset ETag
Header unset Last-Modified
FileETag None
</IfModule>
Update: New Info:
google SpeedTest gives 91/100 score on the top it says: and list all the files except the php generated files that have a explicit expire header set ((which still return full content!??) it says:
The following resources are missing a cache validator. Resources that do not specify a cache validator cannot be refreshed efficiently. Specify a Last-Modified or ETag header to enable cache validation for the following resources.