WebPageTest shows no static cache but I got 304 response in repeated run

122 Views Asked by At

I am testing my webpage with webpagetest.org

On my page, there are a bunch of images. I can see them well cached in the repeated run: (304 response is marked as yellow in WebPageTest waterfall result) enter image description here

However, in cache static content, there's no check on those resources enter image description here

I found the difference is that those scripts and styles have cache-control: max-age=2592000, while those media resources have cache-control: max-age=0 in the server response. Does it mean that WebPageTest will neglect these responses with max-age=0 in static cache checking?

1

There are 1 best solutions below

1
On BEST ANSWER

Does it mean that WebPageTest will neglect these responses with max-age=0 in static cache checking?

The documentation states that resources which include a specific indication of non-cacheability will not be subject to the 'Cache Static' check:

Applicable Objects

Any non-html object with a mime type of "text/*", "*javascript*" or "image/*" that does not explicitly have an Expires header of 0 or -1, a cache-control header of "private", "no-store" or "no-cache" or a pragma header of "no-cache"

While max-age=0 isn't included in that list, it should be treated the same as no-cache, and is likely being treated the same here and excluding those objects from this check.