Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Caching Best Practises at Portal LevelCaching Best Practises at Portal Level
Previous
 
Next
New Post
8/21/2006 4:49 PM
 
Hello,

I noticed a rather silly bug in a module where I was using the cache to store some info.
tabID = (int)base.Page.Cache["TabID"];

This is across the entire application and does not take PortalID into account - hence my other portals were retrieving the same value across all Portals (which could be useful sometimes, but I need to cache at Portal level).

I am going to write a little function to store the PortalID AND the data I want cached, but is there a more efficient method? I noticed this class:

DotNetNuke.Services.Cache.CachingProvider cp = new DotNetNuke.Services.Cache.CachingProvider();

Is there a simple caching method to call by Portal or should I use the method I am using currently (ie. parse a string with Portal ID in it in Page.Cache)




Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
8/23/2006 12:57 PM
 
just don't use caching to store values!!!

ASP.NET (especially 2.0) has a habit of dumping cache wich it thinks is not important. the Cache does not have a scope (defined lifetime)


You should only use the cache to speed up operations

  1. Check if item is in cache
  2. if so use it
  3. if not get from DB and store in cache
  4. goto 1

You will have problems with your modules, especialy on shared hosts with tight settings.



Use the Application or Session scope (classic ASP style) at least these are guaranteed to stay in scope.


EDIT: use something like this:
 value = Int(Application.Item(String.Format("smartthinker{0}-{1}", TabId, PortalId)))

Edit your Skin.xml and Container.xml files with:
Yannick's SXE
 
New Post
8/23/2006 1:06 PM
 
Sorry - my wording was probably not clear...

Basically my UserLink custom web control does a look-up to see where the UserProfile module is being used and then populates NavigateURL with this TabID. If you bind this in a list it is the same TabID for each row (and generally for each screen. Hence the first time it looks it up it caches it and then checks the cache (all my modules use this control any time they show a UserName so which ever accesses it first caches it).

It was more the use of the core DNN cache object vs ASP's?




Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
8/23/2006 1:15 PM
 
ah now I see

If I remember correctly, the caching provider abstraction was introduced to enable loadbalancing and webfarms


default, the caching provider uses regular ASP.NET cache, you can also configure it to store to disk (I guess you would install on a share in this case)


so I guess, sindce DNN alows for a choice, you should respect the choices of the host and use the DNN abstraction

Edit your Skin.xml and Container.xml files with:
Yannick's SXE
 
New Post
8/24/2006 8:38 AM
 

Rodney,

There is DotNetNuke.WebUtility - DataCache, you can use that, although I don't like it.

What I would advise you is to write your own CacheService and make it into your base library for convenience (especially now that we have Generics in .NET 2.0, you can make a rocking CacheService )


Thanks,
Vladan Strigo
NETMedia

My website: Vladan.Strigo.NET

Vladan.Strigo.NET: Projects
* Advanced VS2005 development approach - BlankModule
* DNN & Microsoft Ajax best practices guidance

Vladan.Strigo.NET: Resources
* Comprehensive list of DNN 4 Module development resources

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Caching Best Practises at Portal LevelCaching Best Practises at Portal Level


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out