Is it possible to force Typo3 to refresh websites by an external trigger (e.g. web server cron job or manual trigger)? Could you please describe some best practices?
-
3What do you mean with "refresh"? – StephenKing Mar 05 '16 at 23:34
-
I just want to know, if typo3 websites can be created new ("refreshed") only via the Typo3 backend or in addition by any external triggers e.g. cron jobs or scripts. – Anne Droid Mar 06 '16 at 13:50
3 Answers
Please have a look at Scheduler.
The Scheduler is designed to be the central place to manage all kind of tasks that need to be executed on a regular basis, without needing someone to actually press a button.
If no existing task fits your needs, you can create an own task.

- 509
- 5
- 21
If refreshing means recreating the frontend cache then you could use
config.cache_clearAtMidnight = 1
This will invalidate all FE-Cache entries at midnight, see https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#cache-clearatmidnight for documentation.

- 8,554
- 9
- 29
- 53
If you need to clear the Front End cache, due to external changes to content or whatever, you could use the cache manager from the system extensions and build a small swapper extension to clear specific or all page caches. To go through the framework, you would add a task that can be inserted into the planner in the back end. The planner then would be called by a cron job.
I remember an existing extension for that but I don't remember the exact name right now. However, setting a new one up only requires little code (and helps immensely understanding the caching mechanism).

- 609
- 5
- 14
-
If it needs to be a cron task with no extra code / extension you could also use the extbase cli. This is used for example by TYPO3 surf: https://github.com/TYPO3-Surf-CMS/Surf.CMS/blob/master/Packages/Application/TYPO3.Surf.CMS/Classes/TYPO3/Surf/CMS/Task/TYPO3/CMS/FlushCachesTask.php – sven Mar 07 '16 at 10:18