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

sw-precache: don't fallback if URL starts with /api #3029

Closed
wants to merge 2 commits into from

Conversation

BDav24
Copy link

@BDav24 BDav24 commented Aug 29, 2017

No description provided.

@piotr-cz
Copy link
Contributor

piotr-cz commented Nov 8, 2017

Without this PR, whole section Integrating with an API Backend is irrelevant for production builds.

Moreover examples in tutorials probably won't work in version v0.10+

@react-scripts-dangerous
Copy link

Hello! I'm a bot that helps facilitate testing pull requests.

Your pull request (commit 74b9dc4) has been released on npm for testing purposes.

npm i [email protected]
# or
yarn add [email protected]
# or
create-react-app [email protected] folder/

Note that the package has not been reviewed or vetted by the maintainers. Only install it at your own risk!

Thanks for your contribution!

@piotr-cz
Copy link
Contributor

piotr-cz commented Nov 9, 2017

To explain further: Proxy feature works in development environment but on production any requests that are not cached by service worker will resolve to index.html anyway.

So proxy feature doesn't make sense as in production you have to place API on other origin anyway.

There should be at least one exception for service worker fallback and /api/* is IMHO best one.
I just wonder how to phrase it in User Guide.

Side note: There is a PR #3419 which aims to disable navigateFallback option completely.

@stale
Copy link

stale bot commented Nov 2, 2018

This pull request 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
@stale
Copy link

stale bot commented Nov 7, 2018

This pull request has been automatically closed because it has not had any recent activity. The conversation will be locked in 7 days unless the pull request is reopened. Thank you for your contribution.

@stale stale bot closed this Nov 7, 2018
@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants