Options: Redis for shared caching across workers (with expiry), an in-process cache (functools.lru_cache or a TTL cache) for small, safe data (remember each worker has its own copy), HTTP caching headers (Cache-Control, ETag) for clients and CDNs, and caching model outputs or embeddings by input hash.
Decide on keys, expiry and invalidation up front, and never cache user-specific data under a shared key.
Loading…