TYPO3 has a sophisticated caching system that helps our sites run faster. This is a great thing, but sometimes it gets in the way.
For instance, when you make a change to site-wide content you need to remember to clear the cache in order for it to show up. Also, when actively developing a site, I find myself having to clear the cache every minute and a half in order to check the changes I am making to data structures, templates and TypoScript. To make matters worse, TYO3 4.2 now makes you use a drop down menu to clear the cache which takes just that much longer (Just to be clear though, I really like 4.2).
Anyway, a few weeks ago a I found a single line of TypoScript that has reduced my cache-clearing duties by 95%. The TS property I am talking about is TCEMAIN.clearCacheCmd. I know, I know. The veteran TYPO3 heads are all saying, "Who doesn't know about that." Well, for one, me even though I have been around the TYPO3 block a few times. My guess is that there are more than few others like me out there.
Before I get into the really cool part, let me tell you how this is normally used. Let's say you have a blog with the posts stored in a SysFolder. There is an archive view on a page (id=45), a single view on a page (id=53) and latest view on a page (id=60). You would want to put the following in the page TSconfig of the SysFolder where you store your posts.
TCEMAIN.clearCacheCmd = 45,53,60
What you have done is to told TYPO3 that when ever you add or change a record in the SysFolder then the cache for pages 45, 53 and 60 should be cleared. It works recursively so if you have other folders nested inside the main folder then records changed inside them will trigger the cache clearing as well. This way blog authors do not have to clear the cache every time they edit a post.
That is all a good thing, but this is what really got me excited (which will show it doesn't take much to get me excited).
I consistently set up a group of SysFolders nested like this:
Site Resources
TypoScript
Generated Content-1
Generated Content-2
Their functions are:
In the page TSconfig of the Site Resources folder I add this line:
TCEMAIN.clearCacheCmd = all
So, what happens? The entire site cache is automatically cleared anytime I make a change to TypoScript, side-wide content, data structures, template objects or anything else in those SysFolders.
Anyway, I'm excited.
Saved many clicks for me and whats even more better - no more angry phonecalls from secretary-type editors complaining about stuff not showing up on site :-)