Bug 235535 - Network Cache: do not use disk cache for Fetch media loads
Summary: Network Cache: do not use disk cache for Fetch media loads
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2022-01-24 12:39 PST by Olivier Blin
Modified: 2022-01-31 12:40 PST (History)
14 users (show)

See Also:

Patch (2.50 KB, patch)
2022-01-24 12:43 PST, Olivier Blin
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Blin 2022-01-24 12:39:39 PST
In r183467, checks have been added to avoid putting media resources from XHR requests in the disk cache, since they are likely specific to MSE streaming.
But this does not check for Fetch requests, which can also be used for MSE streaming.

This has been found by using Shaka Player on a low-end device.
Playing high quality MSE content was pushing to the disk cache faster than the device could handle.
Media data was accumulating in the the background IOQueue thread, and the NetworkProcess memory was constantly increasing.

Recently, similar checks have been added for the MSE IPC overhead in r282003.
Loïc found a few differences:
- it supports ResourceLoadInfo::Type::XMLHTTPRequest and ResourceLoadInfo::Type::Fetch, but not ResourceLoadInfo::Type::Media
- it has a different definition of isMediaMIMEType, which adds application/octet-stream to the audio/* and video/* we have in makeStoreDecision()

Should we attempt to factorize these checks?
Comment 1 Olivier Blin 2022-01-24 12:43:28 PST
Created attachment 449846 [details]
Comment 2 Darin Adler 2022-01-24 23:00:28 PST
Comment on attachment 449846 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=449846&action=review

Looks good

> Source/WebKit/ChangeLog:23
> +        No new tests (OOPS!).

Can’t land a patch that still has this in it. Need to remove this line, and replace it with an explanation of why we are landing this patch without any tests. Might want to look back at the original XHR change to see how they wrote the test.
Comment 3 Darin Adler 2022-01-24 23:00:46 PST
(In reply to Olivier Blin from comment #0)
> Should we attempt to factorize these checks?

Comment 4 Radar WebKit Bug Importer 2022-01-31 12:40:18 PST