How do I flush IIS Cache without restarting web server?

Solution 1:

I use iisreset from command line but this restarts the IIS admin service and all dependent services. Which my not be to your liking.

However, it cleanly clears all cache, App Pools and .net cache too.

Solution 2:

You can do it with some ASP.NET code:

foreach(DictionaryEntry entry in System.Web.HttpContext.Current.Cache) {
    System.Web.HttpContext.Current.Cache.Remove((string)entry.Key);
}