What's the best way to implement python cache for better performance? or How does python cache work a

18 Replies, 1758 Views

If you’re using python cache, always add a `maxsize`. Unlimited caches are a ticking time bomb.

Also, don’t forget to clear the cache (`cache_clear()`) during tests. Nothing worse than tests failing because of cached values.

For advanced use cases, `cachetools` is worth a look. It’s like `lru_cache` on steroids.

Messages In This Thread



Users browsing this thread: 1 Guest(s)