After implementing tracking code for recording the response time of API calls using XHR, it was noticed that sometimes the value is null in our reports. After a bit of investigation, it appears that sometimes happens because the response is loaded from the cache in Chromium, so therefore, the calculated response time is 0 ms.
One potential fix for is to set up the XHR to not use the browser cache, but it is not an ideal approach because that puts more load on the servers. Having null values in the reports is also an issue because it is not apparent whether or not the null value is there because the response was loaded from the cache, or due to something failing in various edge cases.
That said, is there a way using JavaScript in Chromium to detect if a response was or was not loaded from the browser cache? Also, this is a single-browser application, so worries about the solution being cross-browser.