cachingtypo3typo3-9.x

How to do cache warmup in TYPO3


In another question, there is the recommendation to setup a cache_clearAtMidnight via TypoScript and do a subsequent cache warmup.

I would like to know how to do this cache warmup because I did not find a scheduler task to do it.

(Clearing the entire cache once a day seems excessive, but the cache warmup seems like a good idea to me in any case.)


Solution

  • As I don't know whether there is an internal mechanism in TYPO3 for cache warming, I built my own little cache warmer based around a simple PHP script (can actually be anything – Python, PHP, Bash,...). The script reads the sitemap.xml and requests each page via cURL.

    I use a custom user agent to exclude these requests from statistics.

    curl_setopt($ch, CURLOPT_USERAGENT, 'cache warming - TYPO3');