The Microsoft.Extensions.Caching.Hybrid package (available in .NET 9) provides a hybrid caching mechanism that allows you to combine both in-memory caching (for fast local access) and distributed caching (such as Redis) for microservices running in multiple pods.
How It Works in a Microservices Setup with Multiple Pods? If data is stored in-memory also, each pod uses its own memory, so if data is refreshed or updated in one pod, how to invalidate the in-memory cache in other pods so it do not return the stale data?
As far as I know, when we use in-memory for data storage in multiple pods application, there is no way the data changed in one pod would get changed in other pods also without any custom implementation. But, want to see if there is anything handled for this usecase within the HybridCache library itself which could handle the multiple pods scenario well and data gets refreshed in each pod?