Pages

Tuesday, May 3, 2016

Enable module caching for logged in users in Joomla

By default Joomla will disable any caching for logged in users. However, I still need Joomla to cache all module even if users logged in.



Unfortunately, I did not find any solution but to hack to joomla core code. So here's what I did:


1. Joomla Version: 3.x. I have no ide if this will work on other Joomla version
2. Open file [Joomla installation folder]/libraries/cms/module/helper.php
3. Search for:
// Turn cache off for internal callers if parameters are set to off and for all logged in users if ($moduleparams->get('owncache', null) === '0' || $conf->get('caching') == 0 || $user->get('id'))
 4. remove $user->get('id'), so your code will looks like:
if ($moduleparams->get('owncache', null) === '0' || $conf->get('caching') == 0)

No comments:

Post a Comment

You may also like

Related Posts Plugin for WordPress, Blogger...