Suppose I have an ASP.NET application running across several web servers behind a load balancer:
Can I:
-
Force OutputCache (Page and/or Control level) to expire globally?
-
Force Data Cache (i.e. Cache.Insert) to expire?
-
Monitor ASP.NET caching usage (keys, RAM, etc) from a central location?
One possible solution would be to have every usage of cache check a file dependency for changes. The file could be touched which would expire all cache. However, this requires developers to include the dependency in all their code. Is their a better solution?
There are many ways to make these caching expire, like page outputcache by
Time-based dependency simply expires the item at a defined point in time.
Now when it comes to monitoring cache, unless there is an API on the cache to tell you, then there is no direct way.
You could of course enumerate the cache,key-value pairs and then calculate the size of each item stored. Doesnt sound easy right??
So here’s to make your cache monitoring easy. Frankly saying i never used it myself, but you can give it a try, just the matter of adding a dll to your application.
And here’s something for your cache keys view,