-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add options for setting Cache-Control #1
Comments
It'd be nice if I could remember how I implemented things from the beginning... By default, most API methods are While this is great from an efficiency standpoint, and is mostly desirable behavior, it requires users to either add an additional The cause of propershark/shark#29 is that the user is not flushing the cache between update cycles, and so after the first request, every subsequent cycle will use the local cache (the parameters never change). The best fix for this would be to include an I'm almost 100% sure that propershark/tripspark_api#1 is a result of this same problem. I'm not going to close this issue yet, since I do think there should be some top-level configuration option for enabling/disabling the cache system, but the immediate issue should be resolved. |
The issue wasn't that the HTTP requests were getting cached, but that the API library (that I wrote, and should have remembered) uses `memoize` on most of its methods, and the Sources here never tried to flush those local caches. To fix this, the `refresh` method for each source now includes an `api.flush_cache` call, which should ensure that a new request is made for every cycle. Note that this solution will hopefully change with the actual fix mentioned in propershark/doublemap_api#1, where there is a global configuration option for caching.
See propershark/shark#29. There should be an option for specifying the
Cache-Control
headers on every request.Since the DoubleMap API is real-time, I think it makes sense to disable caching by default, and allow users to opt-in for individual requests.
See this SO question about how to ensure Caching is always disabled.
The text was updated successfully, but these errors were encountered: