- From: Erin Dachtler <notifications@github.com>
- Date: Fri, 30 Dec 2016 20:48:25 -0800
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/ServiceWorker/issues/1044@github.com>
I'm not really sure if this should be a chrome issue, a fetch issue, or a service worker issue. When a media element (video/audio) seeks to a different position, it fires off a new request for data from that position. So we get a new request for the same resource, but this time with a new `Range` header. In the service worker we need to grab this data from the cache or from the network, but both seem to cause resource contention when several requests come in at once. If, for example, someone uses the seek scrubber on an audio element, 5-10 requests may be sent to the service worker in quick succession. Unfortunately, the service worker has no way of knowing that the audio element has abandoned all but the most recent request, so it dutifully sends responses for each of them. If the requested content is in a cache, the worker sends back the cached response. This seems to cause a lot of data to be loaded into memory all at once (5-10 copies of the response body, which can be upwards of 50Mb for long podcast files or videos). If the content is not available in the cache, then something even worse happens. 5-10` fetch`es are dispatched from within the service worker, which has no idea that most of those requests are no longer needed, and has no way to abort them even if it knew. So the result of seeking though a piece of media served by a service worker is that, best case scenario, your browser slows to a crawl for a few seconds, and worst case scenario, you load 500Mb of uneeded data over a mobile internet connection. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/ServiceWorker/issues/1044
Received on Saturday, 31 December 2016 04:48:58 UTC