Project

General

Profile

Bug #93597

Updated by Jigal van Hemert about 3 years ago

The @runThroughTemplatesPostProcessing@ runThroughTemplatesPostProcessing hook in @TemplateService@ TemplateService is used to add a 'virutal' TS template (based on page properties). 

 In @runThroughTemplates()@ runThroughTemplates() each @sys_template@ sys_template record also adds an item to the @rowSum@ rowSum array (happens inside @processTemplate()@ ). processTemplate(). 
 After caches are cleared a hash from rowSum is used as key for caching all conditions. A hash of all matched conditions is used as key for caching all constants and setup. 

 If two pages only differ in the TS that the hook subscriber adds they will both get the same constants and setup from the cache (rowSum is equal and the same result from the conditions leads to the same key for the constants/setup cache). 

 If the hook subscriber could add items to rowSum the cache key would be different for both pages. 

 h2. Example 

 Situation in site: 
 <pre> 
 +-- start     <-- virtual TS added: "property=1" 
   +-- page1 
   +-- page2    <-- virtual TS added: "property=2" 
   |    +-- page2.1 
   |    +-- page2.2 
   +-- page3 
 </pre> 

 If you clear caches, visit *page1* first the TS constants and setup are stored in cache. If you visit *page2* (or a subpage) after that the rowSum matches, the conditions are the same and thus the constants and setup from page1 are loaded from cache and used for page2 (and subpages). 
 If you clear caches, visit *page2* first that configuration will be used

Back