I have a asp.net web application and I'm using cache (HttpRuntime.Cache) to save some stuff from db.
I also update db from time to time so that data in db does not match the data in my application's cache.
Is there any way how to clear my application's cache without modifying any source code or republishing the page?
I tried to restart IIS and to clear browsers cache but nothing helps.
Please help.
Restarting IIS will work - since the cache is kept in memory. If you're using SQL Server you can set up a cache dependency to automatically expire your cache when SQL Server is updated.
Create admin page for restarting your application and put
HttpRuntime.UnloadAppDomain();
to button_click or similar.
Try this: Clearing Page Cache in ASP.NET
来源:https://stackoverflow.com/questions/2452722/clear-asp-net-cache-from-outside-of-application-not-using-source-code