HighTechTalks DotNet Forums  

HttpContext.Current.Cache behaviour issue

ASP.net Caching microsoft.public.dotnet.framework.aspnet.caching


Discuss HttpContext.Current.Cache behaviour issue in the ASP.net Caching forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Roberta
 
Posts: n/a

Default HttpContext.Current.Cache behaviour issue - 04-13-2006 , 10:43 AM






Hi

I have an issue with the Cache behaviour between a webpart page and ordinary
aspx pages.
The application I've developed used caching already- with a file dependency-
and this worked a treat.

We then updated the webpart to add a dataset we built up in memory to the
cache with options to turn on caching and the cache timeout as toolpane
properties of the webpart.

This worked fine also.
However we have 2 pages that run off the webpart that email the data and
export the data - and we hoped to use this cached dataset for these calls
also- however - when testing this I found very strange behaviour which I
cannot find any documentation on. The dataset is cached on rendering the
webpart with the timeout set. I then launch the new aspx page from the
webpart and in here try to pull the dataset back from the cache using the
correct key ( this i have checked numerous times!) The dataset is not in the
cache at this point ( and is inserted into the cache). I tested this
numerous times - and found that I seem to be looking at two different context
objects? When I Page.Trace HttpContext.Current.Cache.Count in the webpart - I
may have 5 items - I then page.trace the HttpContext.Current.Cache.Count in
the aspx page - and could come back with one.

Once the item is places into the cache in the email page - it remains there
until the timeout . Once its in the cache in the email page- its then
available in the export page!

The idead behind the caching - was that the dataset that was cached - that
the user saw- would be the one that was emailed - this will no longer be the
case - as the one emailed will be the more up-to-date version- and also the
email page will take longer to accomplish its task as it has to regenerate
the dataset from scratch.

Can anybody please spread some light on this issue for me?


Cheers



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.