Two related questions:
1) Is there any existing system / tool for caching requests made via the HTTP gem?
For example: I'm writing an application where we have an API that we read-only, but we have to fetch a lot of data. The data changes regularly and we don't want to download a copy, but it doesn't change constantly. It would be a useful tradeoff to cache responses from that API for say, 5 minutes, so that the lag of fetching that stuff was infrequent, and users would be fine with "it may take up to 5 minutes for changes to show up."
2) As a direct follow up, assuming there's no existing plugin or anything that does this, is it possible to get the Request object and inspect the exact URL / headers that were passed for a request?
Specifically, my get requests almost always have query params. I'm happily taking advantage of HTTP gem's great syntax for this, that means there's nowhere in my app code where I have the full URL string.
So if you're doing something like:
Is there anyway to get the actual URL that HTTP generates? ie.
Thanks!
Andrew