Current time: 11-15-2019, 11:30 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Far futures caching, "set" and "unset" not working, but "append" does. WTF?
01-28-2011, 03:49 PM
Post: #1
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:
# JS - CACHE 1 YEAR
<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
</FilesMatch>

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
Find all posts by this user
Quote this message in a reply
01-28-2011, 10:48 PM
Post: #2
RE: Far futures caching, "set" and "unset" not working, but "append" does. WTF?
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
01-29-2011, 04:38 AM
Post: #3
RE: Far futures caching, "set" and "unset" not working, but "append" does. WTF?
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!
Find all posts by this user
Quote this message in a reply
02-18-2011, 09:32 AM
Post: #4
RE: Far futures caching, "set" and "unset" not working, but "append" does. WTF?
Thompson, have you resolved this issue? My host is using Lightspeed, too, and I may be experiencing the same, or a similar, issue.

Marvin
Find all posts by this user
Quote this message in a reply
02-18-2011, 01:01 PM
Post: #5
RE: Far futures caching, "set" and "unset" not working, but "append" does. WTF?
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
Find all posts by this user
Quote this message in a reply
02-19-2011, 01:04 AM
Post: #6
RE: Far futures caching, "set" and "unset" not working, but "append" does. WTF?
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).
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)