Typoscript Templates: Not all caches are cleared
When I update a Typoscript template the cache (cache_pages, cache_pagesection) is all cleared if I use templates > "setup"
But templates > "Click here to edit whole template record" clears only some cache
Tested with 4.2.8 and 4.5.2 (intro package)
Updated by Thirot no-lastname-given over 9 years ago
I will try to explain the problem.
It is possible to update a template TS in three way.
1) Edit only the setup or the constants (BE -> template -> info/modify -> setup)
2) Edit a specific value via the TypoScript Object Browser (BE -> template -> TypoScript Object Browser)
3) Edit the whole template (BE -> template -> info/modify -> Edit the whole template record)
Methods 1 and 2 clear the cache of the whole site.
Method 3 clears only the cache of child pages.
We will ask someone to resolve this.
Updated by Steffen Gebert over 9 years ago
- Category set to Caching
I would say that editing the whole template record does only clear the cache of the current page (while respecting
TCEMAIN.clearCacheCmd option). This is basically correct, as you're just using the list module to edit this entry.
When you edit only Setup or Constants all Cache is cleared (all Page Cache?). This is basically a bad thing, as you don't want to do that to often on big sites and especially you don't want to clear the whole page cache, if it affects only a subtree.
The correct way would be: Implement prober cache tagging and automatic dropping. Every page cache entry that makes use of a specific TS template should be tagged with the uid of the sys_template record. This does not only solve the problem to not clear all caches, but only the caches of subpages affected by this template, and on the other hand you also drop caches, which use the template record transitively through another record that includes the changed record.
I don't know, if we get automatic cache clearing by tags into 4.7. I plan to talk to Christian Kuhn about this..