Trying to understand more into best practices when dealing with incomplete hierarchical cached data.
Example: I have two caches
- Per Resource cache
{"foo": "bar", "parent", "${Object}"} - Per parent.
[{"foo": "bar", "parent", "${Object}"}, {"foo": "buz", "parent", "${Object}"}]
When a resource is deleted I want to ensure that it is removed from both of the caches AND all of its decedents are also removed.
Originally it appeared like an EventListener could resolve this, however this can quickly cascade in event types if we have a root item (like your C:\ drive) is deleted and it has millions of children. This would register an event for each child item.
Another approach appears to be using topics but I am uncertain if that would give similar performance to EventListeners.
Are there any other routes or ways to listen to cache events only some of the time?