Search code examples
joomla2.5

Why is ModulesAnywhere loading my module 3 times?


It is as simple as that.

I'm referencing my custom module from joomla article using modulesanywhere extension. After experiencing an unacceptably long loading times I've discovered that module file (mod_mymodule.php) is being included 3 times. It loading includes making a web service call lasting couple of seconds, resulting in almost 10 secs for page to load...

Is there anything I can do in mod_mymodule.php to only execute code once?

Thanks v.


Solution

  • It really was ModulesAnywhere to render module before it decides that it won't use the rendered content due to cache settings and returns MO_IGNORE string instead of rendered html.

    Module had 'No caching' as the only option.

    Setting 'Ignore caching' to Yes in ModulesAnywhere plugin Basic Settings did the trick, so now the first time the module is rendered - the HTML is 'accepted' so we have no more lag due to calling web service thrice.