Tags: , , , | Categories: Tip, Web Uygulaması Posted by okutbay on 08.09.2009 17:46 | Yorumlar (0)

"HttpContext.Current.Cache" has a metod to remove items one by one with their key names.

If you want to remove all items from the cache you can use this little code snippet to achive this task:

 

    1 IDictionaryEnumerator enumerator = HttpContext.Current.Cache.GetEnumerator();

    2 while (enumerator.MoveNext())

    3 {

    4     HttpContext.Current.Cache.Remove(enumerator.Key.ToString());

    5 }

Happy coding...

P.S.: This techique don't effect the output cached pages.

Bu yazıyı ilk değerlendiren siz olun

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Yorumlar

Yorum ekle


(Gravatar simgesini gösterecek)  

  Country flag

biuquote
  • Yorum
  • Canlı önizleme
Loading