RUM and how to discern cached traffic?

Hi, I was wondering if is possible to distinguish in RUM browser cached/noncached navigation? I've tried comparing navigationtimings, e.g. if connectStart and connectEnd are equals could mean that content is cached.. but I'm not sure if that is a correct approach and have sense.

Hi @moixcruz,

Checking whether the Navigation is cached vs not cached is really difficult as Browsers doesn't expose fields that lets us measure that and its up to how the Server and Browser are dealing with the HTTP caching headers for a given document in terms of Navigation or Static resources.

  • Browsers also does advanced prefetching for some of the high priority resources which also fills up the cache and its hard to measure as of now.
  • Browsers also have BF cache that can promote a page from restoring it from its own cache without even hitting the server - Back/forward cache

These are being actively worked on by the browser vendors and will be added to the Navigation Timing API in the future - Extend Navigation Timing API to include back/forward cache NotRestoredReasons · Issue #171 · w3c/navigation-timing · GitHub

The only sane thing you could now is to check for transferSize === 0 for the navigated resource document. Its not a recommended approach, however which is why most RUM vendors dont distinguish them - Resource Timing Level 2

Please do let us know if you need more details.


Hi Vignesh, many thanks for the detailed explanation. I had also the feeling that measuring cached in browser was something complex but now I understand exactly. Looking forward to having it in the future!

Thanks /moi

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.