This page describes commands involved in clearing cache from the command line, these commands runs on a web server level.
Cluster note
On Cluster (Setup with several web servers) these commands needs to be executed on each and every web server!
The exception is Content Cache, which in a cluster is shared between each server using Memcached/Varnish/Redis/.. to allow cache to be cleared on content updates.
The Symfony cache:clear command
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:
Integration with Legacy
5.X
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:
- template
- ini
- i18n
For further info on other cache clearing options in legacy see below.
Clearing Content Cache via legacy ezcontentcache command
5.X
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:
For example of use, execute help command above, and/or see legacy documentation on clearing ViewCache.
2 Comments
Ernesto Buenrostro
The last command is wrong
Switching the order in the given parameters works
André Rømcke
Thanks Ernesto Buenrostro, fixed.