python-lru-cache
Saw this:
- learn about
lru_cache
- how does
maxsize=1
help? - when would this help in general?
- when would this NOT be a good idea in general?
- I think
functools.cache
may be recent syntax sugar forfunctools.lru_cache(maxsize=None)
β¦when to choose which? - When to use this instead of
diskcache
(which requires extra calls)? When is this good enough?- Is this good when just caching in memory for current session?
- While
diskcache
is for caching indefinitely?
Caching in Python Using the LRU Cache Strategy β Real Python