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!
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!
