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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Setting Module Cache Time causes infinite page loadsSetting Module Cache Time causes infinite page loads
Previous
 
Next
New Post
1/21/2009 1:44 PM
 

I'm working on a custom module, installed on a fresh DNN 4.9.1 install.  The module works fine in all respects until you turn on the cache (Module Settings -> Page Settings -> Cache Time (secs): ).  Once you set that to a non-zero number and visit the page while NOT logged in, the framework attempts to load the page over and over until either the DB connection pool is saturated or (if you turn off all db access in the module) the stack overflows.

I have debugged this through VS2005/IIS and there are no exceptions being thrown, but as soon as you step all the way through the Page_Load method and continue, it drops right back to the breakpoint at the top of the Page_Load.  Same thing for Page_Init, even if you exit sub directly after the InitializeComponent() method call.

I'm at a complete loss... can someone intimate familiar with the DNN cacheing mechanics shed some light on this issue?  As far as I can tell there are no errors being thrown from the cacheing code or the module code, yet the page continues to reload until it simply can't do so anymore.  This only happens when NOT logged in... the module loads fine logged in as host or admin even with the cache settings turned on.

Hopefully someone out there has a magic bullet :)

Thanks

-Matt Everett
 

 
New Post
1/21/2009 2:38 PM
 

Update:
A test user with no admin permissions experiences the same problem... maybe the admin/host users are bypassing the cacheing mechanism?

Still no luck figuring this one out...

 
New Post
1/21/2009 10:22 PM
 

Module output caching cannot be enabled (by setting the Cache Duration to a non-zero value) if interactive controls need to be available to a user who does not have edit permissions on the module. Output caching is automatically disabled for host/admin and users with edit permissions on the module.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
1/22/2009 10:20 AM
 

Thanks for responding. There aren't any interactive controls that I can think of other than links. Is there a way to disable caching in the module code behind for cases where there are interactive controls?


David O'Leary
Efficion Consulting
 
New Post
1/26/2009 12:23 PM
Accepted Answer 

Well, as it turns out, there was a little more going on behind the scenes that was causing the problem.

Basically, the main ascx control dynamically loads another ascx that provides a configurabe template.  In the code, that ascx was being assigned the module settings of the parent control using a line like this:

oTemplate = LoadControl("Templates/template1.ascx")
oTemplate.ModuleSettings = Me.ModuleSettings

Due to the way PortalModuleBase flags a module as cached (line 674, PortalModuleBase.vb) by inverting the CacheTime parameter, and the fact that both instances now held a reference to the _same_ ModuleSettings object, they continually inverted the parameter, so the page reloaded infinitely.

Once we had determined that, the fix was pretty simple.  Use a clone of the module settings object so that the caching mechanism in PortalModule base doesn't re-invert it's cachetime over and over again.

oTemplate.ModuleSettings = Me.ModuleSettings.Clone()

Problem solved... and more internal DNN knowledge gained.  Yay!

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Setting Module Cache Time causes infinite page loadsSetting Module Cache Time causes infinite page loads


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