• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: [Tip] Lazy Loading.
PostPosted: Wed Aug 24, 2011 8:03 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8165
Location: Fernie British Columbia, Canada
Here's a tip for people that are updating their modules.

For a number of modules that display content, but may not be used on every page, I've enabled frontend lazy loading by merely adding this method:

function LazyLoadFrontend() { return TRUE; }

then bumping the version number.

The system should then load the module only when it's required. This will work fine for many cases. However, if the module provides classes for uses by other modules, or registers multiple plugins then lazy loading is probably not possible.

Additionally, if the module registers an event handler that is called on every page (like ContentPostRender)... then although the lazy loading should work, it's essentially useless as the module has to be loaded on every frontend request anyways. Another reason that that event should be used sparingly.

Just a tip for module developers.

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Lazy Loading.
PostPosted: Wed Aug 24, 2011 8:24 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 4009
Location: The Netherlands
calguy1000 \calguy1000:
Additionally, if the module registers an event handler that is called on every page (like ContentPostRender)... then although the lazy loading should work, it's essentially useless as the module has to be loaded on every frontend request anyways.


Thanks for this explanation... was playing with this on Gallery and was wondering why it still was loaded despite the LazyLoadFrontend function

_________________


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Lazy Loading.
PostPosted: Wed Aug 24, 2011 8:27 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Tue Dec 23, 2008 8:39 pm
Posts: 1369
My module (OwnersManual) is only used in the back end.. I assume that I should use Lazy Loading so that it doesn't get loaded on each front end page load?


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Lazy Loading.
PostPosted: Wed Aug 24, 2011 8:47 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 4009
Location: The Netherlands
Yep, guess so...

And this will help: viewtopic.php?f=6&t=55055

_________________


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Hosting Nation - Managed CMSMS Hosting