DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 21 Aug 2007 07:50:49 -0400,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    David Lozzi am
          2    Steve
          3    unknown
          4    vMike


To cache or not to cache   
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
Date:Tue, 21 Aug 2007 07:50:49 -0400   Author:  

Re: To cache or not to cache   
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


David Lozzi wrote:

> 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
Date:Tue, 21 Aug 2007 08:11:54 -0400   Author:  

Re: To cache or not to cache   
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-Cached-objects

--
Mark Smith
http://aspnetlibrary.com
Date:Tue, 21 Aug 2007 05:13:20 -0700   Author:  

Re: To cache or not to cache   
"David Lozzi" <dlozzi@nospam.nospam> wrote in message 
news:349414F0-000B-4AAB-AA7D-8A0E574FA13B@microsoft.com...

> 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

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
Date:Tue, 21 Aug 2007 11:40:15 -0400   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us