Project

General

Profile

Bug #99162

Updated by Sybille Peters 9 months ago

If a root or extension TypoScript template is modified and saved, the Changes in Templates via EXT:tstemplage BE module (Template editor) result in flush of entire page cache (by "pages" group). 

 Using EXT:tstemplate is flushed. Apparently even pages in other site (in multi-site installation) and redirects cache not the recommended approach. A sitepackage is. BUT, is flushed. this made clear enough? 

 *Reproduce:* h2. Suggested change 

 Make warning / information about this more prominent: 

 * to check look at documentation: make information available that entire page cache entries will be flushed for changes via tstemplate Info module 
 * documentation: add more information what is advantage of sitepackage and problem with maintaining everything in DB, the DB (TypoScript, TSconfig etc.),  
 * documentation: add more information how to migrate e.g. 

 <pre> 
 select id,identifier,FROM_UNIXTIME(expires) from cache_pages; 
 </pre> 

 * Templates in dev environment use X-TYPO3-Debug-Cache DB to check if page loaded sitepackage (which is pretty straightforward but might be helpful to have a tool which creates a readymade sitepackage from cache an existing site, such as "migrate2composer":https://extensions.typo3.org/extension/migrate2composer) 

 e.g.  

 <pre> 
 curl -I http://t3coredev13/autogenerated-239/subpage 
 ... 
 X-TYPO3-Debug-Cache: Cached page generated 09-08-23 13:49. Expires 10-08-23 13:49 h2. Related 

 </pre> 


 1. flush entire cache 
 2. load What about "introduction" package? EXT:tstemplate is used there as well, on the one side we recommend "sitepackage", on the other side we use "introduction" package to teach TYPO3. 

 h2. More details 

 Currently, there is just a page in FE hint that it is best practice to use a sitepackage here: https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/UsingSetting/Entering.html 

 But there is no information why and there is no information what will happen if you don't or if you use a mixed mode (such as sitepackage with extension templates, not root templates or site package, but modify the constants via CURL 
 3. look at the template module). 

 Recently, I noticed, the entire page cache entries and check X-TYPO3-Debug-Cache HTTP header 
 4. edit and save is flushed, apparently on every change: 

 - even for the other sites if you are in a TypoScript record in different site (in multi-site installation) installation 
 5. check cache again - even for changes in extension templates (not root templates) 
 - even for changes in constants 

 before: (tested this in v11, but code for v12 looks vaguely the same) 

 <pre> see DataHandlerClearCachePostProcHook::clearPageCacheIfNecessary 

 <pre><code class="php"> 
 select id,identifier,FROM_UNIXTIME(expires) from cache_pages; if (($parameters['table'] ?? '') === 'sys_template') { 
             $this->cacheManager->flushCachesInGroup('pages'); 
         } 
 +----+----------------------------------------------------+------------------------+ 
 | id | identifier                                           | FROM_UNIXTIME(expires) | 
 +----+----------------------------------------------------+------------------------+ 
 |    1 | redirects_aa0b2df6a8e4384ef665c2ccc69ff2733a7a2b98 | 2023-08-09 14:52:03      | 
 |    2 | redirects_df58248c414f342c81e056b40bee12d17a08bf61 | 2023-08-09 14:52:03      | 
 |    3 | 239_62fbe8f8b6f1723e5eff1cbd89e0acd2360b30d0         | 2023-08-10 13:52:03      | 
 +----+----------------------------------------------------+------------------------+ 

 </pre> </code></pre> 


 after: h2. Personal experience 

 empty 


 *Affected versions* 

 Not I am using a new issue, was this was since v11 at least, reproducible site package, but we also still have several extension templates and there is still some TypoScript in v13 


 Possible solutions 

 1. change the behaviour if possible (e.g. flush only cache entries affected by the change) 
 2. if behaviour will root template.  

 I was not be changed, make administrators aware that the entire page cache will be was flushed after for the entire installation if these are edited, even for the other sites when editing the templates. 

 I recently added a monitoring which sends me a warning when number of page cache entries 

 * a) e.g. drops suddenly by saying a large amount. It is very annoying and tedious to track down the various reasons for this in the flash message which appears on save 
 * b) mentioning this somewhere in the documentation, e.g. https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/UsingSetting/Entering.html 


 ... 
 a production site.

Back