I am trying to add instrumentation code to calculate the total time a client takes to fetch a resource(image, video...) from server.
This is the code:
const response = await fetch(url, {headers});
This response is loaded into a HTMLImageElement using new Iamge()
and src
is pointed to url of the blob using createObjectURL
.
I want to ignore the request time if the image was pulled from cache. I see the message in chrome dev tools next to response status (from disk cache
).
is there a way to access it in my code ?