We have a complex domain model. To avoid performance issues, most of the list (generated from domain objects) are cached. Everything works well until the first domain object changes. All depending list in the cache must be refreshed - the question is: how?
No doubt, there is a very easy way: after saving a domain object, we refresh all list from code manually.
Pseudo code
repository.Save(save);
cacheManager.Invalidate("HouseList");
cacheManager.Invalidate("OrderedHouseList");
cacheManager.Invalidate("HousecombinedWithResidentsList");
...
So the problem is: we have to refresh everything manually. I'm looking for better solutions, let's say:
Any idea or experience?
The answer to this question is complex because your requirements are unclear. Can data be stale? If so, how long?
Based on the limited information in your post, I would suggest the "cached" views merely being a query over the real data. The queries themselves could periodically refresh their cached results given some interval.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With