WebPagetest Forums
Magic? F in "cache static content" but requests go from 55 to 2 in repeat view - 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: Magic? F in "cache static content" but requests go from 55 to 2 in repeat view (/showthread.php?tid=13977)



Magic? F in "cache static content" but requests go from 55 to 2 in repeat view - greenjobs - 10-09-2015 04:54 AM

I have run several tests on the web site of the German Solar Industry Association - and the results are consistently only "F"s (something I have never ever seen before in webpage test): http://www.webpagetest.org/result/151008_VG_14W1/

The one thing that absolutely really puzzles me: None of the static resources comes with a max-age or expires header. And still: They are not downloaded in the repeat view. In repeat view, only the HTML page itself and the Piwik statistic script is called (requests go down from 55 to 2, Bytes from 1,051 KB to 35kB).

How is this possible? Why don't the browsers (I tested FF and Chrome) try to download the static assets, again? What caching mechanism is used here?

OK, I found out, why the browsers do not re-download static assets: Using LiveHTTPHeaders on my local FF, I can see that in fact there are expires headers sent. The time is short (just one week), but it is enough to no re-download the assets.

The strange thing is: If I look at the http response given in WPT, no expires headers show up. They seemed to be stripped from the reply of the server. The browsers use them nevertheless.

Is this a bug in WPT? I tested two different instances with the same result...?


RE: Magic? F in "cache static content" but requests go from 55 to 2 in repeat view - pmeenan - 10-09-2015 05:23 AM

When there is no expires header the browser can use heuristics based on last-modified to decide how long to cache it for (most modern browsers do). That's why you don't see them re-requested.

You can grab a tcpdump to be positive but WPT captures the data from the wire so I'm fairly certain they weren't sent.


RE: Magic? F in "cache static content" but requests go from 55 to 2 in repea... - greenjobs - 10-09-2015 06:59 PM

Thank you for taking the time to personally answer my question, Pat! And many thanks for giving us Webpagetest. I have used it for years; it is such an amazing tool.

(10-09-2015 05:23 AM)pmeenan Wrote:  When there is no expires header the browser can use heuristics based on last-modified to decide how long to cache it for (most modern browsers do). That's why you don't see them re-requested.
That makes a lot of sense - thank you for the explanation!

(10-09-2015 05:23 AM)pmeenan Wrote:  You can grab a tcpdump to be positive but WPT captures the data from the wire so I'm fairly certain they weren't sent.
I re-checked and you are absolutely correct. I mistakenly looked at the request of a CSS-file for which there is a short expires time set. The images really do not have any expires header.