WebPagetest Forums
static resources not cached? - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Discuss Test Results (/forumdisplay.php?fid=4)
+--- Thread: static resources not cached? (/showthread.php?tid=12120)



static resources not cached? - Torsten Robitzki - 03-20-2013 02:15 AM

Hallo,
first of all: "wonderful tool!" :-)

Second, I have a test where I see requests to static content in a repeat view, where I've expected the browser to cache the *.js, *.css and *.png files:

http://www.webpagetest.org/result/130319_58_WNR/

Can someone spot, why the resources are not cached?

TIA

Torsten


RE: static resources not cached? - sbardoux - 03-23-2013 11:53 AM

Same here, I've been running testing for a couple of month, it's only recently (around some default setting have changed) that the contents are no longer cached, I haven't seen much setting to toggle it so my guess is that our host only can control that.

Would be really nice to have it working like before.

Thanks

PS: I was using Dulles defaults, I switch to Chicago and the browser is caching content, I guess the settings are not the same.

This tool is really awesome !!


RE: static resources not cached? - Torsten Robitzki - 03-23-2013 08:57 PM

I just saw, that the cloudfront server responses with HTTP 1.0. Maybe that's the reason, that the IE is more conservative.


RE: static resources not cached? - pmeenan - 03-27-2013 12:00 AM

It looks like there are 2 sets of cache-control headers in the responses:

Code:
Cache-Control: max-age=31536000, public
Cache-Control: no-cache="set-cookie"

I haven't done much testing with a field-specific no-cache setting before but I wouldn't be surprised if that was causing the issue.


RE: static resources not cached? - Torsten Robitzki - 03-27-2013 05:57 AM

Hm, and in my case that header is served via a cdn where cookies aren't set anyway. Thanks for pointing that out, I will try to get rid of the second Cache-Control header.


RE: static resources not cached? - Torsten Robitzki - 04-10-2013 03:03 AM

Hi,
I boiled this down a little bit and thought maybe someone came across the same issue. My setting is a home grown http server running a rails application on a EC2 server. Before that server is a load balancer with Session-Stickiness enabled. To serve static files, CloudFront is used and configured to use the load balancer as orgin server.

Because of the session stickiness, the LB adds the ´Cache-Control: no-cache="set-cookie"´ to the response. The orgin server serves the files with the ´Cache-Control: max-age...´ header. According to the http 1.1 rfc, the headers are fine and must be read like one header with 3 values.

One the other hand, the CloudFront server is using http 1.0 and IE9 seems to ignore the first header. With IE10 this seems to be fixed.