Current time: 12-09-2019, 02:45 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
False negative? - FAILED (No max-age or expires)
06-10-2010, 12:05 AM
Post: #1
False negative? - FAILED (No max-age or expires)
Ive been playing with webpagetest for last few weeks, but from last 2 - 3 days i have a strange issue.

The result in discussion is at http://www.webpagetest.org/result/100609...9331716a5/

In the first view, these requests(served via Internap CDB) are listed as cachable while in the repeat they arent.

http://i.ticdn.com/header_bg.gif
http://i.ticdn.com/menu_bg.gif
http://i.ticdn.com/side_bg.gif
http://i.ticdn.com/tab_bg.gif

Firefox 3.6.6pre does not check for these files for each view (checked wia firebug). Neither does IE6 (monitored activity via wireshark) ...

I havent tested this in IE7 or 8 yet .

I think the only change i did was to add "Vary: Accept-Encoding" header so that only gzip compatible browsers get gziped content...

FYI here are the headers for http://i.ticdn.com/header_bg.gif

Code:
HTTP/1.0 200 OK
Date: Wed, 09 Jun 2010 13:00:54 GMT
Expires: Mon, 19 Jul 2010 13:00:54 GMT
Server: nginx/0.7.65
Content-Type: image/gif
Content-Length: 6133
Last-Modified: Sun, 05 Nov 2006 06:25:24 GMT
Cache-Control: max-age=3456000
Vary: Accept-Encoding
Cache-Control: max-age=3456000, public
Accept-Ranges: bytes
X-Origin-Date: Tue, 08 Jun 2010 14:45:49 GMT
X-Origin-Expires: Sun, 18 Jul 2010 14:45:49 GMT
X-Cache-Age: 78637
X-Cache: HIT from cdce-nym011-015.nym011.internap.com
X-Origin-Date: Wed, 09 Jun 2010 12:36:26 GMT
X-Origin-Expires: Mon, 19 Jul 2010 12:36:26 GMT
X-Cache-Age: 1468
X-Cache: HIT from cdce-nym011-015.nym011.internap.com
Via: 1.1 cdce-nym011-015.nym011.internap.com:1082 (squid/2.7.STABLE7), 1.0 cdce-nym011-015.nym011.internap.com:80 (squid/2.7.STABLE7)
Connection: keep-alive

cdnplanet.com: We help you select the right CDN
Visit this user's website Find all posts by this user
Quote this message in a reply
06-10-2010, 12:17 AM
Post: #2
RE: False negative? - FAILED (No max-age or expires)
How did you do your IE6 repeat view test (did you close and re-open the browser)?

Aaron Peters bumped into this the other day and was going to work on a blog article about it but it turns out that if you add a vary header for the content encoding but don't gzip the actual content IE will not honor the cache. In other words, it works fine for text that gets gzipped but don't add the header to image responses.

-Pat
Visit this user's website Find all posts by this user
Quote this message in a reply
06-10-2010, 12:20 AM
Post: #3
RE: False negative? - FAILED (No max-age or expires)
Found a doc on it here: http://code.google.com/speed/page-speed/...ching.html

Set the Vary header correctly for Internet Explorer.
Internet Explorer does not cache any resources that are served with the Vary header and any fields but Accept-Encoding and User-Agent. To ensure these resources are cached by IE, make sure to strip out any other fields from the Vary header, or remove the Vary header altogether if possible


I need to add a check to pagetest to detect the vary header and fail those assets.
Visit this user's website Find all posts by this user
Quote this message in a reply
06-10-2010, 12:25 AM (This post was last modified: 06-10-2010 01:08 AM by sajal.)
Post: #4
RE: False negative? - FAILED (No max-age or expires)
aha seems like ill have to not put the vary header for non-text files....

For the IE6 test i did it in a vm and monitoring the http using Wireshark.

Did a CRTL+R to force reload. saw all files being fetched, then just pressed enter on the addressbar. Now after reading your response i tried the refresh icon, IE6 sent the if-modified-since requests again... so confirmed this is IE issue and not webpagetest...

Now i need to search on how to set headers based on types in Nginx... will report back if Vary fixes it or not.
ok fixed using nginx's gzip_vary directive

http://wiki.nginx.org/NginxHttpGzipModule#gzip_vary

this only adds vary to gzipable stuff

cdnplanet.com: We help you select the right CDN
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)