Far futures caching, "set" and "unset" not working, but "append" does. WTF?

Hi, Has anybody every encountered this with far futures caching?

For some reason “unset” and “set” don’t work. “Unset” doesn’t remove the header value. And “set”, which is supposed to remove the current value and use the new, only adds the new value onto the old resulting in two values for a given header item! My host is baffled and I may go nuts.

My goal, for JS is to:
remove etags
remove last modified
set expires modified header - access plus 1 year
set cache control header - access plus 1 year

My .htaccess:


<FilesMatch “.(js)$”>
Header unset Pragma
Header unset ETag
FileETag None
Header unset Expires
Header unset Cache-Control
Header set Cache-Control “max-age=31536000,public”
Header set Expires “A31536000”
Header unset Last-Modified

I realize I shouldn’t have to use unset Expires and unset Cache-Control. But even explicitly doing it, it doesn’t remove the old values! YSlow shows that my new values are only being appending ONTO the old. So there’s TWO values for each. Any ideas what’s wrong? Is it possible that a host’s server can force these values to remain?

Response header as shown in Yslow:
Content-Encoding gzip
Vary Accept-Encoding
Date Fri, 28 Jan 2011 00:26:05 GMT
Server LiteSpeed
Accept-Ranges bytes
Etag “127f-4d41fdf8-0”
Last-Modified Thu, 27 Jan 2011 23:21:28 GMT
Content-Type application/javascript
Content-Length 2137
Cache-Control max-age=63556926,public, max-age=0
Expires A63556926, Fri, 28 Jan 2011 00:26:05 GMT

Bugs in Lightspeed? You can try using mod_expires directly instead of header directives:

ExpiresActive On
ExpiresByType image/gif A31536000
ExpiresByType image/jpg A31536000
ExpiresByType image/jpeg A31536000
ExpiresByType image/png A31536000
ExpiresByType image/bmp A31536000
ExpiresByType text/css A31536000
ExpiresByType text/javascript A31536000
ExpiresByType application/javascript A31536000
ExpiresByType application/x-javascript A31536000

That said, you ETags rules match mine exactly and mine are working fine and since it looks like mod_headers (ot the equivalent) is doing “something” I’d chalk it up to a web server bug - looks like your host is using an “apache compatible” server and not apache itself.

My host is indeed using lightspeed. I think you must be right that it’s a bug because even adding ExpiresByType as you said gives the same results. I’ve sent lightspeed a bug report and link to this thread. Thanks Patrick!

Thompson, have you resolved this issue? My host is using Lightspeed, too, and I may be experiencing the same, or a similar, issue.

Unfortunately, Lightspeed didn’t respond to me and hasn’t resolved the issue from what I can tell. Maybe you can send them a bug report too? bug -AT- litespeedtech -DOT- com

Make sure to apply pressure to your hosting providers as well since they are the ones actually paying lightspeed for the product (presumably because they can support more simultaneous vhosts on a given platform).