FIX: Excessive video data downloading from service worker (#24924)

This bug appears to only be on Chrome due to the service worker fetching
the video content on page load instead of on play. For some reason
though the service worker would fetch around 4x more than the size of
the video resulting in excessive data being downloaded especially for
larger videos.

meta https://meta.discourse.org/t/287817
internal /t/111387/52
This commit is contained in:
Blake Erickson 2023-12-15 13:29:50 -07:00 committed by GitHub
parent 6e2201135f
commit 7a7c53894d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -121,6 +121,11 @@ workbox.routing.registerRoute(
return false;
}
// Exclude videos from service worker
if (args.event.request.headers.has('range')) {
return false;
}
var matching = cdnUrls.filter(
function(url) {
return args.url.href.startsWith(url);