Since Automne 4.0.2, XHTML code produced by polymod modules rows can be cached.
This cache concerns the generated content by the XML code in the rows inside block tags:
<block module="polymod-codename"> ... </block>
Please check rows tags syntax for the polymod modules for more information about this tag.
The cache system was written to improve the performance of the display of modules data and also for SEO. Of course, it doesn't affect the freshness of the data displayed to the users. Automne will override rows cache parameters everytime you update the modules datas in the administration interface
Processing modes
-
Automatic cache
By default, every row containing a block tag related to a polymod module will have a 24 hour cache preset.
The default mode is available for all rows for blocks that doesn't contain a cache attribute of if the attribute cache is set to 1:
<block module="polymod-codename" cache="1"> ... </block>
Moreover if a block contains PHP code, cache will be automatically disabled.
The default duration if 24 hours can be modified in the config.php file via the CACHE_MODULES_DEFAULT_LIFETIME constant.
For instance, it you want the cache to last one week:
define("CACHE_MODULES_DEFAULT_LIFETIME", "604800");
-
Forced cache
You can force the duration of a cache by specifying the number of seconds in the cache attribute of the block tag.
For instance if we want the cache to last for one hour :
<block module="polymod-codename" cache="3600"> ... </block>
If you force the cache and you have PHP code in your row, you can tell the cache system what your PHP code refers to. So Automne will be able to automatically reset your cache if the reference is modified.
The atm-cache-reference allows to specify what your code refers to.
-
Disabled cache
You can force to disable the cache if you set the cache attribute of a block tag to zero (0).
<block module="polymod-codename" cache="0"> ... </block>
Reset cache and exceptions
- Polymod modules cache can be globally disabled, you have to set CACHE_MODULES_DATA constant in the config.php file to false.
define("CACHE_MODULES_DATA", "false");
- You can also delete the whole cache in Automne administration in the server settings, "File Access" tab by clicking on the "reset Polymod cache" button.
- Cache will be disabled if POST data are present when the page containing the row is loading
- Cache content for the row will be automatically deleted if the content of the module(s) it refers is modified (either addition, modification or deletion of elements or categories)