Reputation: 7525
I am maintaining an application in which the developer has used data caching in the following manner:
HttpContext.Current.Cache["key"] = myDataSet;
He hasn't specified when this cache gets invalidated. The myDataSet
is a result of a SELECT from the database. The database was updated, but the cache is not invalidated. I do not want to change the source code. I simply want to invalidate it. I tried iisreset
with no luck.
Upvotes: 1
Views: 1141
Reputation: 34337
If you re-save the web.config
, the app pool will recycle more gracefully than an iisreset
, with the same result for the cache.
Upvotes: 3
Reputation: 84
iisreset should work. Whenever the ASP.Net application is unloaded from memory it will clear out any server managed Session data. Even just touching the web.config should unload the app.
Upvotes: 1
Reputation: 7525
iisreset
did work! I did'nt notice the changes as the IE was caching the datasets. So, the original question is not fully accurate.
Thanks
Upvotes: 0
Reputation: 10247
The solution is going to be somewhat dirty anyway if you can't change the code (the clean way would be to use SqlCacheDependency).
Can you change the Global.asax.cs (although it's source code as well)? You can access the HttpContext from here and empty the cache in your code.
Upvotes: 1