I have an admin application in which I manipulate my objects in the db, and a public asp.net mvc application which is mostly for viewing these objects.
I have implemented a simple caching for a few objects, which uses HttpRuntime.Cache.
I want to invalidate parts of the cache of the public application from the admin application.
The simplest solution was to make a ClearCache() action which clears every record in the cache when called.
But wouldn't it be better to utilize a caching which uses cache dependencies? I don't know which would be the best to use and how. I was thinking about an sql dependency, but since I'm doing the caching to skip sql queries I'm not sure that this would be fast.
Is checking sql cache dependencies slow? I wish to use the cached objects in a LOT of cases, checking for the sql dependency each time does not sound good.