This page describes commands involved in clearing cache from the command line, these commands runs on a web server level.
On Cluster (Setup with several web servers) these commands needs to be executed on each and every web server! |
Out of the box Symfony provides a command to perform cache clearing. It will delete all file based caches, which mainly consists of Twig template, Symfony container, and Symfony route cache. However as it deletes everything in folder ezpublish/cache/<environment>/*
this also implies Symfony Proxy being deleted if you use that for Symfony HTTPCache (the default single sever choice) as opposed to Varnish, and eZ Persistent Cache unless you use Memcached.
For information of use, see the help text of the command:
php ezpublish/console cache:clear -h |
The Symfony cache:clear
command is extended via Legacy (Bundle/Bridge) to also clear legacy cache.
Prior to version 5.3.5 and 5.4.2 the command cleared all default cache items in legacy, however as of these releases (see EZP-24048) this is now like the Symfony command itself deleting only code related caches, and not content related caches. Specifically the following legacy cache "tags" are now cleared:
For further info on other cache clearing options in legacy see below.
For Cluster setups or other setups where Varnish and/or Memchached is used, the legacy cache clearing command can be used to delete content cache both in legacy, and in Platform stack thanks to ViewCache integration in Legacy Bundle/Bridge.
For using it make sure you use ezpublish:legacy:script
, like this:
php ezpublish/console ezpublish:legacy:script --legacy-help bin/php/ezcontentcache.php |
For example of use, execute help command above, and/or see legacy documentation on clearing ViewCache.