for node client
304 only maybe to delegate the cache store...?A>SDF>ASDF
We are hitting an API with superagent that makes heavy use of caching headers and ETags. If we were to implement something like https://github.com/kevinswiber/request-caching in concert with superagent, would that seem like a good solution? Is there method of integration the best, or would you recommend some other way to integrate with superagent?
I know this is old, but I recently published a superagent extension that adds transparent caching. You can see it here: https://github.com/jpodwys/superagent-cache.
https://github.com/jpodwys/superagent-cache does not care about HTTP Caching but caches by it's own rules.
That's true. I'm happy to look into opening up a plug-in architecture so others can add that functionality without forcing it upon everyone. There is also a fork of superagent-cache-plugin that adds http cache support. You can find the fork here: https://github.com/finanzcheck/superagent-cache-plugin/tree/feature/CORE-440-respect_response_cache_headers
@jpodwys thanks a lot for sharing this 馃憤
I just wanted to let it written somewhere on the Internet how there's a lot of custom caching solutions for JS HTTP requests out there, instead of following actual standards like... HTTP Caching headers. I'm using Axios and found nothing that could reliably and simply respond to the ETag standard. Checked "rival tech" and there's two packages from the same developer: one with 76 stars and is a custom implementation, and another that has ETag support and... 10 stars.
Any sense of reinventing this wheel?
HI @igorsantos07! I'm the author of both of the libraries you mentioned.
superagent-cache-plugin V3 (currently available as a beta release) uses the excellent http-cache-semantics written by @kornelski who is a superagent maintainer.
You might have a look at the the V3 release and see if it meets your needs.
@igorsantos07 I, too, think first-party HTTP cache support would be great! However, I'm curious if you're putting too much emphasis on how many stars a repo has. I think it's more meaningful to look at how many times a library is being downloaded. You can see superagent-cache-plugin's download history here.
Another interesting thing to consider is who is using a library. You can find that info here.