Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Handle range requests for streamable resources #270

Open
1 task done
toshify opened this issue Dec 3, 2021 · 3 comments
Open
1 task done

fix: Handle range requests for streamable resources #270

toshify opened this issue Dec 3, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@toshify
Copy link
Collaborator

toshify commented Dec 3, 2021

Describe the bug

Sometimes when loading new content, Chrome will request only the first few bytes of mp3 files,
using a range request, and the server provides the range with a 206 response,
but then Chrome proceeds to complain that a range response cannot be cached.

Steps to reproduce

  1. Visit liaizhongzi.com
  2. Open Inspector (F12), go to Application, Storage, Clear site data
  3. Go to Inpector > Network, then reload page
  4. Wait for media resources to load
  5. Observe error message in console after 10-20 sec

Expected behavior

No error.

Environment

  • Device: PC
  • OS: Ubuntu 20.04
  • Browser Chromium
  • Version 96

Additional context

registerServiceWorker.ts:10 Service worker has been registered.
registerServiceWorker.ts:16 New content is downloading.
StrategyHandler.js:314 Uncaught (in promise) TypeError: Failed to execute 'put' on 'Cache': Partial response (status code 206) is unsupported
    at U.cachePut (StrategyHandler.js:314)
    at async k._handleInstall (PrecacheStrategy.js:138)
    at async k._handle (PrecacheStrategy.js:70)
    at async k._getResponse (Strategy.js:144)
cachePut @ StrategyHandler.js:314
@toshify toshify added the bug Something isn't working label Dec 3, 2021
@toshify
Copy link
Collaborator Author

toshify commented Dec 3, 2021

Workaround:
Reload page, wait 30-60 seconds, reload again,
or Inspector, Application, then Unregister all serviceworkers, then reload.

@toshify
Copy link
Collaborator Author

toshify commented May 12, 2022

@toshify
Copy link
Collaborator Author

toshify commented Nov 16, 2022

We are currently loading mp3 files as base64 encoded data, so Chrome and other browsers do not identify the mp3 files as streamable, and so that currently circumvents this problem. However, we may want to revert to using native mp3 at a later time, and may need to handle this at that point.

@toshify toshify assigned toshify and unassigned toshify Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant