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

Service worker should cover only the PUBLIC_PATH route #4320

Closed
FezVrasta opened this issue Apr 17, 2018 · 3 comments
Closed

Service worker should cover only the PUBLIC_PATH route #4320

FezVrasta opened this issue Apr 17, 2018 · 3 comments

Comments

@FezVrasta
Copy link
Contributor

FezVrasta commented Apr 17, 2018

Is this a bug report?

yes

Did you try recovering your dependencies?

Not related

Which terms did you search for in User Guide?

service worker

Steps to Reproduce

(Write your steps here:)

  1. Enable the service worker
  2. set homepage to a sub-folder in package.json
  3. Try to open another page running in a different sub-folder

Expected Behavior

The current service worker file (serviceWorker.js) doesn't addresses the case when the app is server from a sub route, it should make sure to cache and serve assets only on the PUBLIC_PATH route.

Actual Behavior

The service worker will try to cache and serve all the domain assets.

Reproducible Demo

No demo needed I guess. (and anyway I'm not sure how to provide one actually)

@Timer
Copy link
Contributor

Timer commented Apr 17, 2018

/cc @jeffposnick

@jeffposnick
Copy link
Contributor

I'm not sure what action to take here—the service worker, as it's currently set up, will precache everything that's included in the webpack build by default. Changing that to a different behavior would be a fairly significant breaking change for folks who do choose to use the generated service worker.

That being said, this should be viewed in the context of #3924 and the related to change to make service worker usage opt-in. Folks who don't want the precaching behavior will presumably not opt-in.

@stale
Copy link

stale bot commented Nov 2, 2018

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs.

@stale stale bot added the stale label Nov 2, 2018
@Timer Timer closed this as completed Nov 2, 2018
@lock lock bot locked and limited conversation to collaborators Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants