Cache options for custom control

H

Henke

Hi,

I want to develop a function which will display a menu system based on a
hieracy which is fetched from a database.
For performace reason I would like to cache the menu structure per-user for
all pages the user will visit.
The problem here is that I can not use the session object for caching
because the control will be used on aspx pages in SharePoint and by default
sessions is disabled for some reason (probably for loadbalacing reason).
Wher developing controls for SharePoint you create "web parts" which has it
owns cache function built-in. I can not use web parts for this task, because
the menu will be displayed on all pages and without a "web part zone"

I have read about caching for user controls and I´m not sure if that is a
better way to move forward with this task.

Any advice how to handle this issue?

Regards,

// Henk
 
P

pH

Maybe the easiest way would be a Dictionary (map) object stored in the
Application collection, or perhaps as a static member of the user
control class, with the usernames as keys and your menu data as the
value. Then you could retrieve the data relevant to whoever was
accessing the page, without actually needing a Session object.

This method is not particularly elegant, but it should work and would
be quite easy to code.
 

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

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top