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

Don't extend key life beyond original timeout #6

Open
jdunck opened this issue Mar 24, 2011 · 1 comment
Open

Don't extend key life beyond original timeout #6

jdunck opened this issue Mar 24, 2011 · 1 comment

Comments

@jdunck
Copy link

jdunck commented Mar 24, 2011

I think it'd be good if newcache didn't extend key life. Currently, .set extends to timeout + HERD_TIMEOUT. I realize that the miss should later re-call set, but if it fails to, the key lives beyond its intended lifespan.

I think it would be good to (optionally, maybe) instead back off the given timeout so that a miss is before the given timeout.

I did this a long time ago, but shows the general idea:
http://code.djangoproject.com/attachment/ticket/6199/cache_avoid_stampede.diff

@jdunck
Copy link
Author

jdunck commented Mar 24, 2011

I should note, if you're happy to take this upstream, I'm happy to do the work.

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

1 participant