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
Cache API data #3
Comments
See also #10. |
I'll go with Redis Cloud for right now as planned, though I suspect Google will be a better idea (if nothing else, their free tier gives more space). But the Moneta gem should mostly let us abstract that difference (famous last words, I know). |
Since we're doing Redis Cloud for the moment, I guess I'll set up a local Redis instance. |
Even better if it works: https://github.com/iainbeeston/faraday_api_cache. If not, I'll fall back to using api_cache manually. |
Well, that gem hasn't been touched since 2014, but it looks like https://github.com/sourcelevel/faraday-http-cache is maintained. Trying it. |
Nope, that doesn't support current Faraday. Something probably does, but I'll use api_cache manually if I have to. |
Looks like the version at sourcelevel/faraday-http-cache#116 should support current Faraday. Let's see if it works... |
I think I should first create a Faraday::Connection instance that underlies all API requests, then I can add caching to that. |
Unbelievably, it's hard to get the URL from a Faraday request before I make it. Considering switching to a different library (HTTP-rb?) so I can have more control of what requests I'm making. |
Incredible. HTTP allows you to build a request and see its URL, but then not fire it as far as I can tell, or to fire it but not see its URL. WTF? Anyway, rest-client may do the trick. |
It didn't, but after all that, Typhoeus will. Plus it may be nice to run 30 requests through the hydra at some point. |
We'll probably cache API data for 24 hours.
The text was updated successfully, but these errors were encountered: