You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be nice if I could remember how I implemented things from the beginning...
By default, most API methods are memoized, meaning that requests with the same parameters will use a local cache, rather than resending requests to the source.
While this is great from an efficiency standpoint, and is mostly desirable behavior, it requires users to either add an additional true parameter to reset the cache at call time, or call #flush_cache on the containing object before making a new request.
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 api.flush_cache call at the top of refresh in each source.
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.
Activity
faultyserver commentedon Sep 24, 2016
It'd be nice if I could remember how I implemented things from the beginning...
By default, most API methods are
memoized, meaning that requests with the same parameters will use a local cache, rather than resending requests to the source.While this is great from an efficiency standpoint, and is mostly desirable behavior, it requires users to either add an additional
trueparameter to reset the cache at call time, or call#flush_cacheon the containing object before making a new request.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
api.flush_cachecall at the top ofrefreshin each source.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.
Closes #29. Flush API caches on each update cycle.