How to reset IIS (or otherwise clear the cache) when restarting a web application?

I am working on an ASP.NET application that stores a lot of cached data. This data remains cached when I restart the application, so I need to reset IIS if I want to re-run the code that receives the data, otherwise it is just taken from the cache. Is there a way to automate this?

+3
source share
2 answers

Running iisresetfrom a command prompt with a higher value (in Vista / Win7 / Win2008) will restart IIS and all hosted applications. This is very fast if you release the command line prompt: up arrow and enter to repeat the last command.

+7
source

Where do you store data? In the application object?

If so, try calling Application.Clear () on the Application_Start method in the global asax

+1
source

Source: https://habr.com/ru/post/1749907/


All Articles