I'm working on an ASP.NET app that keeps a lot of data cached. This data remains cached when I restart the app, so I have to reset IIS if I want to rerun the code that gets the data, otherwise it's just taken from the cache. Is there a way that I can automate this?
views:
60answers:
2
A:
Where are you storing the data? In the application object?
If so, try calling Application.Clear() in the Application_Start method in global asax
adrianos
2010-06-14 10:31:58
I think that if the app restarts, the application object will be empty anyway.
Timores
2010-06-14 11:05:26
The data is stored in `System.Web.Caching.Cache`
DaveDev
2010-06-14 14:07:01
Cheers Timores, that's probably true. Dave, on http://msdn.microsoft.com/en-us/library/system.web.caching.cache.aspx I noticed this link http://msdn.microsoft.com/en-us/library/edfcywt6(v=VS.100).aspx which might be helpful to you
adrianos
2010-06-14 15:26:48
A:
Running iisreset
from an elevated (on Vista/Win7/Win2008) command prompt will restart IIS and all hosted applications. This is very quick if you keep the command prompt open: up arrow and enter to repeat last command.
Richard
2010-06-14 10:32:21