-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Migrated issue, originally created by s (sontek)
Currently dogpile.cache has the created time stored in metadata in the cache, inside value.metadata["ct"] but doesn't expose this anywhere.
We have some very heavy operations and even if the cache gets invalidated, we want to let it stay stale for up to 5 minutes afterwards during high traffic but we need to pull be able to decide when to regenerate the cache based on the size of the survey.
For example,
If we have a survey that has only 10 respondents, we want to invalidate the cache every time a new respondent comes in.
If a survey has 500 respondents or more, even while new respondents are filling out the survey, we would like to leave the cache in place for up to 5 minutes before we regenerate it.
I would be happy with a get_with_metadata and get_or_create_with_metadata, that way after the call I could inspect the age of the cache from metadata['ct'] and decide if I should invalidate it.