Thanks to visit codestin.com
Credit goes to hub.docker.com

gordalina/cachetool

By gordalina

Updated 3 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

Content type

Image

Digest

sha256:d41a69f1d

Size

34.7 MB

Last updated

3 months ago

docker pull gordalina/cachetool:10.0.0