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.
[Tip] Lazy Loading.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
[Tip] Lazy Loading.
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.
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.
Re: Lazy Loading.
Thanks for this explanation... was playing with this on Gallery and was wondering why it still was loaded despite the LazyLoadFrontend functioncalguy1000 wrote: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.
Re: Lazy Loading.
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?