HighTechTalks DotNet Forums  

Advice: cache data from slow source that is updated often

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


Discuss Advice: cache data from slow source that is updated often in the ASP.net Caching forum.



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

Default Advice: cache data from slow source that is updated often - 11-03-2004 , 10:40 AM






Hi everyone...

so I've got a couple of webforms (AddItem and EditItem) that do straight
forward record creation and editing. The problem is that on the form, is a
DropDownList that has to query a slow datasource (propietary) for its
values... it takes about 15 seconds to load the form.

My question is, what techniques can I use to speed this up? Here's what
I've thought about:

- cache the query results into a dataset somehow... this would mean that I'd
have to periodically refresh the data, so what events (techniques) are best
used to do this?

- thread the query somehow so that the page loads and the dropdownlist
(which is further down the page) gets updated when the query is done.

Thanks,
Michael



Reply With Quote
  #2  
Old   
Ben Strackany
 
Posts: n/a

Default Re: Advice: cache data from slow source that is updated often - 11-12-2004 , 05:17 PM






You can put the dropdown into a user control & do partial page output
caching to cache that control.

You can cache the dataset & assign an expiration value to it. The expiration
would be based on how often the data is updated. You could also use cache
dependencies also. Your code would check to see if the item was in the
cache, if it wasn't, it would requery the database & populate the cache
again.

You could also do an ansynchronous type of thing -- have your page
dynamically load a javascript file that's actually an ASPX page (e.g.
filldataset.aspx), and that ASPX page would access the database & returns
javascript commands to dynamically populate a dropdown. Search on
"dynamically load javascript" on google to learn more about it.

I vote for #2. Do some reading on MSDN/gotdotnet/etc to get more background.

--
Ben Strackany
www.developmentnow.com

<a href="http://www.developmentnow.com">dn</a>


"Michael Reinhart" <nope (AT) nope (DOT) com> wrote

Quote:
Hi everyone...

so I've got a couple of webforms (AddItem and EditItem) that do straight
forward record creation and editing. The problem is that on the form, is
a
DropDownList that has to query a slow datasource (propietary) for its
values... it takes about 15 seconds to load the form.

My question is, what techniques can I use to speed this up? Here's what
I've thought about:

- cache the query results into a dataset somehow... this would mean that
I'd
have to periodically refresh the data, so what events (techniques) are
best
used to do this?

- thread the query somehow so that the page loads and the dropdownlist
(which is further down the page) gets updated when the query is done.

Thanks,
Michael





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 - 2008, Jelsoft Enterprises Ltd.