Reputation:
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.)
Upvotes: 4
Views: 1603
Reputation: 3230
Updated (Feb 14, 2024):
There is an extension warming by Elias Häußler which warms up the page cache by using the sitempa.
You can also do an initial warmup of some caches (not a full warmup of all pages) by using TYPO3 core functionality:
php vendor/bin/typo3 cache:warmup -h
e.g.
php vendor/bin/typo3 cache:warmup
Btw, cache_clearAtMidnight
does not clear the cache at midnight, it sets the expire time to be at midnight. Once the cache has been expired, on next page hit, it will be regenerated. Has the same effect, but might be good to know.
Upvotes: 0
Reputation: 1488
You can use this ext. Its simple wget wrapper but you can add it as Scheduler task.
https://github.com/visuellverstehen/t3fetch
Upvotes: 0
Reputation: 106
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');
Upvotes: 2