CLI App and library to manage apc & opcache
50K+
CacheTool allows you to work with APCu, OPcache, and the file status cache through the CLI. It will connect to a FastCGI server (like PHP-FPM) and operate on its cache.
Why is this useful?
Note that, unlike APCu and Opcache, the file status cache is per-process rather than stored in shared memory. This means that running stat:clear against PHP-FPM will only affect whichever FPM worker responds to the request, not the whole pool. Julien Pauli has written a post with more details on how the file status cache operates.
Images are available in docker hub and github container registries:
gordalina/cachetool:latestghcr.io/gordalina/cachetool:latestThis is an example run with the web adapter:
APPDIR="/var/www/example.com"
DOCROOT="/var/www/example.com/current/web"
URL="http://example.com"
docker run --rm -v $APPDIR:$APPDIR -w $DOCROOT gordalina/cachetool cachetool --web --web-url=$URL [options] [arguments]
If the website is behind a proxy and/or load balancer you may want to ask directly the webserver instead of the public facing ip. Additionally, the webserver may be listening in another port. This is an example for running cachetool from the webserver host in such a setup:
DOMAIN="example.com"
PORT="8008"
APPDIR="/var/www/example.com"
DOCROOT="/var/www/example.com/current/web"
URL="http://$DOMAIN:$PORT"
docker run --rm --add-host $DOMAIN:172.17.0.1 -v $APPDIR:$APPDIR -w $DOCROOT gordalina/cachetool --web --web-url=$URL [options] [arguments]
Thank you to @jonhattan and @NITEMAN for the work with docker.
Content type
Image
Digest
sha256:d41a69f1d…
Size
34.7 MB
Last updated
3 months ago
docker pull gordalina/cachetool:10.0.0