Cache options for custom control
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?
Re: Cache options for custom control
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.
|All times are GMT. The time now is 12:44 PM.|
SEO by vBSEO ©2010, Crawlability, Inc.