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

Fastboot doesn't run with http://localhost:4200/?fastboot=true, but does on CURL #572

Open
omairvaiyani opened this issue Feb 9, 2018 · 5 comments

Comments

@omairvaiyani
Copy link

omairvaiyani commented Feb 9, 2018

We have just begun to add fastboot to our project, and have run into this issue.

Starting the server with ember serve does not seem to use fastboot by default when I visit localhost:4200?fastboot=true from the browser. It does however run with this command in terminal curl 'http://localhost:4200/' -H 'Accept: text/html'.

The ember-cli terminal only prints App is being served by FastBoot when I make the request via CURL, but not if I visit via the browser. Could this have anything to do with our use of a service worker?

@simonihmig
Copy link
Contributor

Could this have anything to do with our use of a service worker?

Absolutely! I would recommend disabling SW while developing.

@omairvaiyani
Copy link
Author

Thanks @simonihmig that was the culprit!

Just as an aside, will the use of service workers have any bearing in the production environment?

@scottkidder
Copy link

@simonihmig I would also like to know if there is any interaction between fastboot and ember-service-worker in production?

@simonihmig
Copy link
Contributor

Yes, depending on your SW's implementation, a user might hit your FastBoot server only for the first ever visit. After that any following visit would not load the HTML page from the server, but rather use the index.html cached by your SW. At least that's how ember-service-worker-index would behave.

@scottkidder
Copy link

I see, that makes sense. Maybe it should be documented in ember-service-worker-index? Maybe a better setup for sw + fastboot would involve allowing ember-service-worker-cache-fallback to serve index.html only when network is unavailable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants