What's the best way to implement a Python cache for performance optimization? or How does Python cach

16 Replies, 1751 Views

If you’re doing heavy computations, `joblib.Memory` is worth a look. It’s like `lru_cache` but saves to disk, so it survives restarts.

Cache invalidation? The classic “hard problem” lol.

One hack: hash your inputs + a “version” string. Change the version when data updates.

Also, `functools.cached_property` is neat for class attributes!

Messages In This Thread



Users browsing this thread: 1 Guest(s)