Caching confusion in the client
Heard of a use case recently where a user had a notebook instance open for a while and ran into an issue with caching. The user called APIClient(resources='all') but did not see new endpoints they expected to see (because they already called it earlier and the results were cached before the endpoints were created).
My impression is that it's not trivial to refresh lru_cache in smart way to avoid this and since this is a rare occurrence, we should address it with documentation.
This doesn't seem like it should be that difficult to write code rather than docs for. Maybe we could a (spec, datetime) tuple and check the time.
fwiw, the CLI has code for invalidating old cached specs, but it depends on file metadata.
Maybe this would work?
oh, nice. cachetools looks interesting.
To be clear, this is an instance where the Civis API changed mid-notebook session and the user wanted to access the new API endpoint(s) from an existing notebook, correct?
To be clear, this is an instance where the Civis API changed mid-notebook session and the user wanted to access the new API endpoint(s) from an existing notebook, correct?
Yes, exactly.