Skip to content

Don't extend key life beyond original timeout #6

@jdunck

Description

@jdunck

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions