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

Skipping request by returning a Response in beforeRequest #157

Closed
hugomrdias opened this issue Jul 31, 2019 · 3 comments · Fixed by #172
Closed

Skipping request by returning a Response in beforeRequest #157

hugomrdias opened this issue Jul 31, 2019 · 3 comments · Fixed by #172
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@hugomrdias
Copy link
Contributor

This could be useful for internal caching, mocking, etc..
Would this be an acceptable feature ?

@sholladay
Copy link
Collaborator

Seems like an interesting idea. But I'm curious why the built-in caching mechanisms are not sufficient? You can specify the caching mode for each request.

See: https://developer.mozilla.org/en-US/docs/Web/API/Request/cache

@hugomrdias
Copy link
Contributor Author

hugomrdias commented Jul 31, 2019

For my specific case I'm trying to reduce the number of parallel requests (due to browser limits) with a local cache. Can't use http cache because the API doesn't have the proper headers. Don't ask why 😅.
Still this can be useful for other use cases and isn't too intrusive.

@sindresorhus
Copy link
Owner

Sounds useful. PR welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants