Pages

Tuesday, May 3, 2016

Enable com_content 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 com_content 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]/components/com_content/controller.php
3. Search for function display($cachable = false, $urlparams = false)
4. in display function search for:

if ($user->get('id') || ($this->input->getMethod() == 'POST'

4. remove $user->get('id'), so your code will looks like:
if (($this->input->getMethod() == 'POST'

No comments:

Post a Comment

You may also like

Related Posts Plugin for WordPress, Blogger...