Search code examples
google-chrome-devtoolsperformance-testingcdnweb-performance

Size/Content Column in Chrome Network Tool showing non consistent results for Amplience CDN


Attached are three screenshots from Google Chrome Network Tools for the same website.

They are filtered to show images from the Amplience CDN

The results shown in the Size/Content column vary and I am trying to understand why.

Each screenshot is taken from the point of view of a returning user. Therefore the images should come from Cache.

Screenshot 1 - Shows a big difference between Size on Disk and Transfer Size. Screenshot 2 - Shows that one of the images is now NOT cached Screenshot 3 - the term (from Cache) is now displayed.

My questions are:

  1. In screenshot 1, why does it not say (from cache)? What is happening in the small amounts of Transfer Size that is not happening in screenshot 3?

  2. Why is it that one image is suddenly not cached?

    Screenshot 1 - big difference between Size on Disk and Transfer Size Screenshot 2 -  one of the images is now NOT cached Screenshot 3 -  the term (from Cache) is now displayed


Solution

  • My responses:

    1. In screenshot 1, why does it not say (from cache)? What is happening in the small amounts of Transfer Size that is not happening in screenshot 3?

    If you had the "Status" displayed, you'd probably see a "304 Not Modified". In this case, the cache was used AND the network was used. A request was sent to the server and the response only contains headers that are 257 bytes long.

    1. Why is it that one image is suddenly not cached?

    There can be many reasons so it's hard to answer without more information.

    • It could be that you asked for a "hard refresh" (Ctrl + Shift + R).
    • It could be that the response contained a "Age" header that was bigger than the "Cache-Control: max-age=xxx", or a "Date" header that was too far in the past.
    • I can also think of a case when the browser sends a request with a "If-modified-Since" header or a "Etag" header, and your servers (in your case the CDN servers) do not all respond with the same information.
    • Browsers sometime remove things from the cache, usually when they need to make space for some other files.