Bug 202019 - Video Element Progressive Download of MP4 Makes Poorly Behaved Network Requests
Summary: Video Element Progressive Download of MP4 Makes Poorly Behaved Network Requests
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari 12
Hardware: All macOS 10.14
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-09-19 19:06 PDT by Colin McFadden
Modified: 2021-06-07 07:31 PDT (History)
3 users (show)

See Also:


Attachments
Inspector showing the range requests (864.42 KB, image/png)
2019-09-19 19:06 PDT, Colin McFadden
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Colin McFadden 2019-09-19 19:06:09 PDT
Created attachment 379186 [details]
Inspector showing the range requests

We vend MP4 video from AWS S3 buckets, which are displayed using a standard <video> element.  WebKit initially buffers a sizable amount of video from the server, and then closes the connection.  When it needs to load additional data (as playback progresses), it makes a 206 Partial Content request with a Content-Range requesting the entire remainder of the file.  After loading a small amount of data (roughly 2 megabytes in our environment), the connection is aborted.  

Because the content-range request asked for the entire remainder of the file, and because the connection was aborted, this causes excessive billing and data transfer on the server side.  In our environment with AWS S3, a connection in which the WebKit client loads ~2 megabytes will incur ~12 megabytes of billed data.

Ideally would set the content-range more accurately according to the data it actually intends to load, or would maintain a single long-running connection to the server (this is the current behavior in Chrome). 

I can provide a test environment if necessary, but would rather not do so publicly as the testing process could expose us to substantial costs.
Comment 1 Radar WebKit Bug Importer 2019-09-20 12:22:29 PDT
<rdar://problem/55568259>
Comment 2 Alexey Proskuryakov 2019-09-20 12:23:11 PDT
> I can provide a test environment if necessary, but would rather not do so publicly as the testing process could expose us to substantial costs.

Please feel free to e-mail me, I will then add the testing details to an Apple internal ticket.
Comment 3 Alexey Proskuryakov 2020-07-03 16:18:37 PDT
Sorry for the delay. This was determined to be an issue in an underlying framework below WebKit, so we can't track it here. It will continues to be tracked by Apple internally.
Comment 4 ae 2021-06-07 07:31:24 PDT
I just stumbled upon this issue as well while implementing 'Range' requests in our webserver.

It's quite disturbing to know that this issue probably doubles global internet bandwidth usage and environmental impact! Crazy.