Actions

Difference between revisions of "Why do you get more module cache files in version 1.5.11?"

From Joomla! Documentation

(New page: Since Joomla! 1.5.11 the modules are cached for every page, so lots of cached files are created for the menu items with lots of pages. To revert this back to previous caching behavior you...)
 
(add more information about the bug fix)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Since Joomla! 1.5.11 the modules are cached for every page, so lots of cached files are created for the menu items with lots of pages.
+
Prior to version 1.5.11, modules where the content can change depending on the Menu Item ID or Article ID were cached incorrectly. For example, the Related Items module will show different articles based on the current article in view. Caching this module did not work correctly prior to version 1.5.11.
  
To revert this back to previous caching behavior you need to edit /libraries/joomla/document/html/renderer/module.php and change the line
+
This problem was corrected in version 1.5.11. As a result of this fix, module cache files are created for each combination of module, Itemid, and Article ID. In practice, this means that you will now see a lot more module cache files, especially if you have a lot of articles and menu items. These files are small and should not take up a lot of storage space or cause other problems.
  
$contents =  $cache->get( array('JModuleHelper', 'renderModule'), array( $module, $params ), $module->id. $user->get('aid', 0).md5(JRequest::getURI()) );
+
If you like, you can change the behaviour back to what it was prior to version 1.5.11 with a simple code change, shown below. Note, however, that this means that module caching will not work correctly for Related Items and other similar modules.
 +
 
 +
To revert this back to previous caching behavior you need to edit <code>/libraries/joomla/document/html/renderer/module.php</code> and change the line
 +
 
 +
<source lang="php">$contents =  $cache->get( array('JModuleHelper', 'renderModule'), array( $module, $params ), $module->id. $user->get('aid', 0).md5(JRequest::getURI()) );</source>
  
 
to
 
to
  
$contents =  $cache->get( array('JModuleHelper', 'renderModule'), array( $module, $params ), $module->id. $user->get('aid', 0) );
+
<source lang="php">$contents =  $cache->get( array('JModuleHelper', 'renderModule'), array( $module, $params ), $module->id. $user->get('aid', 0) );</source>
 +
 
 +
[[Category:Version 1.5.11 FAQ]]

Latest revision as of 13:53, 3 June 2009

Prior to version 1.5.11, modules where the content can change depending on the Menu Item ID or Article ID were cached incorrectly. For example, the Related Items module will show different articles based on the current article in view. Caching this module did not work correctly prior to version 1.5.11.

This problem was corrected in version 1.5.11. As a result of this fix, module cache files are created for each combination of module, Itemid, and Article ID. In practice, this means that you will now see a lot more module cache files, especially if you have a lot of articles and menu items. These files are small and should not take up a lot of storage space or cause other problems.

If you like, you can change the behaviour back to what it was prior to version 1.5.11 with a simple code change, shown below. Note, however, that this means that module caching will not work correctly for Related Items and other similar modules.

To revert this back to previous caching behavior you need to edit /libraries/joomla/document/html/renderer/module.php and change the line

$contents =  $cache->get( array('JModuleHelper', 'renderModule'), array( $module, $params ), $module->id. $user->get('aid', 0).md5(JRequest::getURI()) );

to

$contents =  $cache->get( array('JModuleHelper', 'renderModule'), array( $module, $params ), $module->id. $user->get('aid', 0) );