Cache

M

Maury

Hello,
I need to clear ASP.NET 1.1 Cache
(I use HttpContext.Current.Cache)
WITHOUT changing the code or
recompiling the app,
how can I do this ?
Have I to change web.config?

Thanks
M.
 
K

Karl Seguin [MVP]

There are really two core ways.

First is to make the worker process restart. There are a lot of ways to
achieve this, including touching the web.config, stopping and restartig the
website in IIS and changing the code.

The Cache object can also programmatically be manipulated. Just like you are
adding items to it, so to can you remove them. You could create a password
protected page which does something like:

IDictionaryEnumerator enumerator = Cache.GetEnumerators();
while (enumerator.MoveNext())
{
Cache.Remove(enumerator.Key);



}

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,787
Messages
2,569,630
Members
45,335
Latest member
Tommiesal

Latest Threads

Top