Event though I can't answer the possible causes for this strange wait time, I do know how to reduce it.
We are able to intercept a fetch event in service worker with event.respondWith(). Somehow, in my case, when my page needs to load a vendor's javascript via script tag with my service worker defaults to intercept every fetch event to perform cache-then-network (for assets) or network-only (for data fetching) like this:
if (shouldLoadOfflinePage) {
fetchEvent.respondWith(cacheManager.fromCache(new Request(offlinePage)));
} else if (shouldFromCache) {
fetchEvent.respondWith(cacheManager.fromCache(fetchEvent.request));
} else {
fetchEvent.respondWith(fetch(fetchEvent.request));
}
The last block intercepts a network-only request which is pretty unnecessary to do. This unnecessary block somehow causes a blocking load (but I don't know what blocks it):
long request to serviceworker wait time: ~400ms
So I decided not to intercept unnecessary fetch-interception (of course by removing the last block):
if (shouldLoadOfflinePage) {
fetchEvent.respondWith(cacheManager.fromCache(new Request(offlinePage)));
} else if (shouldFromCache) {
fetchEvent.respondWith(cacheManager.fromCache(fetchEvent.request));
}
Then my page needs only 16ms to load the aforementioned file.
Hope this will help