-
Notifications
You must be signed in to change notification settings - Fork 10
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
Respect Server response Cache related headers. #6
Respect Server response Cache related headers. #6
Conversation
valdemon
commented
Aug 1, 2017
- done with the usage of the opinionated https://www.npmjs.com/package/http-cache-semantics
- adopted tests
- additional test cases
- support for client request cache related headers
- README.md updated
- adopted tests - additional test cases - support for client request cache directive headers - README.md updated
- added 'bypassHeaders' to 'pruneHeader' automatically, - test case for the 'bypassHeaders'.
- returning cloned response from a cache. - optimized 304 handling.
Hi thank you for this PR! I apologize for my late response. When I wrote this library, I had two primary goals for code maintenance:
While this PR adds important convenience, it also 1) significantly increases the download size and 2) increases the barrier to entry by requiring that a transpiler be used for browsers lacking ES6 support. If I were to merge this PR, I would need to cut a breaking release due to the new requirement for a transpilier (cutting a breaking release does not bother me). However, before talking more about merging this PR, I'd like to discuss the possibility of making this PR into either a superagent plugin that coexists with superagent-cache-plugin, or perhaps a plugin that can be used to directly modify superagent-cache-plugin. I know that sounds odd, but it would give users the freedom to choose whether they want to download the extra code at all--I don't like the idea of forcing all users to download code they're unlikely to use unless it's only a marginal increase in download size. What are your thoughts? |
Closing due to lack of response. |
@valdemon At the time you originally submitted this PR I was overly hesitant to add third-party libraries. I was wrong in that regard. You've done excellent work here and I'd like to merge your fork. I'll go ahead and work on resolving merge conflicts. Please let me know if you have any thoughts. A number of people have requested this feature, the latest of which can be found here. |
Hi @jpodwys cool to hear that! |
Hey, Im the latest requester for this. I scanned the fork and the PR. If I can help somehow let me know. |
@valdemon @hottehead I've merged this and published it to NPM as I'd love to port these changes over to superagent-cache sometime soon as well. Not sure when I'll have time to work on that right now, though. @valdemon thank you again for these changes! @hottehead thanks for the push to merge this in. |