functools.lru_cache, cachetools, diskcache and Memcached
In-process caches (lru_cache, cachetools), on-disk caching (diskcache) and a distributed memory cache (Memcached via pymemcache).
Easy
@lru_cache(maxsize=256) memoises pure functions in one line.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.