Forums / Developer / Cache-Block-Usage? / Comment39307
Paul Borgermans
Tuesday 02 December 2003 9:43:44 am
Hi Marco,
Whether or not you provide keys, the template cache system will create additional ones based on the template file name and path, the position of the cache-block in the file and the current siteaccess. So multiple cache-blocks in a template file with no explicit keys still get a unique key. This works even if different siteaccess use the same design (and templates within). The latter is necessary because the content may differ with siteaccess.
The use of keys is mandatory when you use the cache-block in a template and the content of the cache-block can be different. For view templates, I would recommend at least the node_id +the userid (if different users have different roles). You may add other variableshere too.
For use in pagelayouts and you have navigation menus which remain constant, it is safe to use no keys at all for the surrounding cache-block. Otherwise, you will need a key which discrimnates the different content (eg the user id when roles affect the menus to display).
hth
-paul
eZ Publish, eZ Find, Solr expert consulting and training http://twitter.com/paulborgermans