Replies: 1 comment
-
|
Thanks @gitdevb! The blocker here is invalidation correctness: tying eviction to
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks @gitdevb! The blocker here is invalidation correctness: tying eviction to
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Proposing a native, decorator-based caching layer to redis-py. While redis-py provides excellent low-level commands (
get, set,etc.), developers must repeatedly write boilerplate code to handle cache lookups, insertions, and invalidations within their application logic.Adding built-in decorators would bring standard, Pythonic caching patterns directly into the ecosystem (similar to
functools.lru_cache, but backed by Redis).Proposed API Design
We can introduce a Cache utility class or expand the client to support decorators that manage the CRUD lifecycle of cached data:
1. Standard Fetch & Cache
2. Cache Invalidation / Eviction
Argument Breakdown
ex, px, nx).Use Cases & Benefits
if cache_hit: returnpatterns across user codebases.@Cache.deletedirectly to data-mutating functions.Beta Was this translation helpful? Give feedback.
All reactions