I'm logging all the http requests' performance data from a Service Worker on a tab by tab basis ("clientId" property of the "fetch" event). Resource Timing API provides all the high resolution timing data I need. But I can't get those data for specific requests. If there are 5 tabs, and all the tabs request to http://api.example.com/resource, from the service worker's scope, the performance entries have stored all the 5 requests without any distinguishing property and I can't map specific requests to the performance entries.
Yeah, I know I can mark the timings with performance.now()
before and after the fetch requests. But I need other data like TTFB, DNS timing, etc. and I can only measure them from the data provided by the Resource Timing API.
How do I get the high resolution timing data like for specific requests?
performance.getEntriesByType("resource")
returns data for all the resources loaded. I just need those data for specific async requests.