Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

To cache or not to cache

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Lozzi - 21 Aug 2007 12:50 GMT
That's really not the question. The question is how do I clear all cache
programatically? For example, I want to implement cacheing on some data
driven pages however after the employees update the data on the pages i'd
like to give them the option to reset the cache so they can see the changes
instantly. How can I do this for the entire web application/web site?

Thanks!
David Lozzi
Steve - 21 Aug 2007 13:11 GMT
Why not use something like a for-each loop with the Cache object? You
can call the Remove() method of the Cache object to remove items.
Remember that Cache is global, not session-specific. If you have all
users accessing the data in the Cache, make sure you're aware sees the
same data.

Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA

> That's really not the question. The question is how do I clear all cache
> programatically? For example, I want to implement cacheing on some data
[quoted text clipped - 5 lines]
> Thanks!
> David Lozzi
ca8msm@aspnetlibrary.com - 21 Aug 2007 13:13 GMT
Unfortunately, there is no Clear method so I generally loop through
them and remove each item e.g.

http://aspnetlibrary.com/codebankdetails.aspx?type=Cache&codebank=Clear-all-Cach
ed-objects


--
Mark Smith
http://aspnetlibrary.com
vMike - 21 Aug 2007 16:40 GMT
> That's really not the question. The question is how do I clear all cache
> programatically? For example, I want to implement cacheing on some data
[quoted text clipped - 5 lines]
> Thanks!
> David Lozzi
As other have said you can loop through or if you know exactly which item
you want to remove you can just use the remove method -- here is a snip

  dim objItem as DictionaryEntry
  dim strName as String

  For Each objItem In Cache
      strName = objItem.Key.tostring()
      cache.remove(strName)
  Next

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.