diff --git a/deploy.php b/deploy.php index 68b3d06..d33f6f7 100644 --- a/deploy.php +++ b/deploy.php @@ -188,11 +188,23 @@ task('deploy', [ // Caches belong to the release that goes live, so they are cleared after the symlink flip. Hooking // into deploy:symlink rather than appending to the list above keeps them inside deploy:publish, ahead // of deploy:unlock and deploy:success - a failing cache task must not follow a declared success. -// No OPcache reset (cachetool): its web adapter would need PHP under www.ep-reisen.de/typo3temp, which -// is the static docroot. Not needed either: the front controller stubs in the static docroots resolve -// "current" with readlink() on every request, so a new release is always loaded under new paths. +// No OPcache reset (cachetool): its web adapter would need PHP under a host's typo3temp, and the +// stubs in the static docroots resolve "current" with readlink() on every request. Vhosts that point +// at current/public pick up a new release once PHP's path cache expires: see typo3:cache:flush:delayed. after('deploy:symlink', 'typo3:cache:flush'); // A rollback switches the code back; pages cached by the other release must not survive it after('rollback', 'typo3:cache:flush'); +// Vhosts that point at current/public (unlike the stubs) keep running the previous release for a +// while after the switch: PHP caches the resolved "current" path (realpath_cache_ttl, 120 s by +// default) and OPcache the compiled files. Pages rendered in that window land in the page cache +// after the flush above, so flush once more when it has passed. +desc('TYPO3 - Clear all caches again once PHP has picked up the switched release'); +task('typo3:cache:flush:delayed', function () { + run('sleep 150'); + invoke('typo3:cache:flush'); +}); +after('deploy:success', 'typo3:cache:flush:delayed'); +after('rollback', 'typo3:cache:flush:delayed'); + after('deploy:failed', 'deploy:unlock');