- From: Philip Walton <notifications@github.com>
- Date: Wed, 27 Sep 2017 22:55:11 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 28 September 2017 05:55:33 UTC
For my use case the Cache API.
Essentially what I'm wanting to do is something like this:
```js
const startTime = performance.now();
const response = await fetch(url);
const duration = performance.now() - startTime;
const wasCached = determineSomehowIfResponseCameFromCacheApi(response);
sendDataToAnalyticsService({
url,
duration,
wasCached,
});
```
And since my service worker will sometimes be responding to the fetch event with a cached response, I want to know how often that happens and compare the actual savings via RUM.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/608#issuecomment-332735138
Received on Thursday, 28 September 2017 05:55:33 UTC