Skip to content
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

Enable Cache to handle stale values #38

Open
hkraal opened this issue Jul 27, 2016 · 2 comments
Open

Enable Cache to handle stale values #38

hkraal opened this issue Jul 27, 2016 · 2 comments
Milestone

Comments

@hkraal
Copy link
Contributor

hkraal commented Jul 27, 2016

As suggested by @bargulg in #22 there should be room for caches like Redis to clean up their own stale values. Currently the expired logic takes place in APIConnection.get() which decides if a cache would be valid or not.

My thoughts:

  • Determining if the cache is expired is not up to APIConnection but the loaded caching plugin
  • The caching plugin should decide if it wants to use a relative or absolute time
  • The code in APIConnection.get() shouldn't be doing more then res = cache.get('key'), if res.valid: ... and cache.put('key')
@hkraal hkraal added this to the v0.1.0 milestone Jul 27, 2016
@jonobrien
Copy link
Contributor

I like this idea, we just need more fleshed out workflows for implementing those cache mechanisms, and how each should work, unless you want to leave that up to the end-users of PyCrest.

@jonobrien
Copy link
Contributor

you could just set a flag for variable or absolute time as well, if they all could be used/tested in the same manner, reducing user confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants