VOOZH about

URL: https://hub.docker.com/r/gordalina/cachetool

⇱ gordalina/cachetool - Docker Image


gordalina/cachetool

By gordalina

•Updated 8 months ago

CLI App and library to manage apc & opcache

Image
0

50K+

gordalina/cachetool repository overview

⁠CacheTool - Manage cache in the CLI

šŸ‘ DockerHub Badge

šŸ‘ Build Status
šŸ‘ Coverage Status

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?

  • Maybe you want to clear the bytecode cache without reloading php-fpm or using a web endpoint
  • Maybe you want to have a cron which deals with cache invalidation
  • Maybe you want to see some statistics right from the console
  • And many more...

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.

⁠Usage

Images are available in docker hub and github container registries:

  • gordalina/cachetool:latest
  • ghcr.io/gordalina/cachetool:latest

This 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⁠.

Tag summary

10.0.0

Content type

Image

Digest

sha256:d41a69f1d…

Size

34.7 MB

Last updated

8 months ago

docker pull gordalina/cachetool:10.0.0