Caching scenario suggestions

N

npverni

I have a navigation bar user control that is very expensive to create
from the database. This toolbar will only change when the user
navigates to a different section (there are three in total). What I
would like to do is cache the toolbar while the user is in a current
section, and only load it again when they change sections. Or , if I
could somehow cache all three on the initial page load and then
programatically load the desired one from the cache that would also
work. Any suggestions?

Also, the way the application is setup - the current section is not
stored in the querystring, rather the navigation controls discover the
section recursively from their parent pages.

Thanks
 
G

Guest

npverni,
The best "pattern" to use is to have a method that gets the data from the
database.
First, it will check the cache for DataSet, datatable, however you do it.
If the data is not present in Cache, then and only then will it make a
database call, and it will immediately cache the DataSet. Then it returns the
dataset.

You should not need to cache your actual controls, only the database action
result.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top