Skip to main content
Version: 7.x

cachetool

Source

Add to your deploy.php

require 'contrib/cachetool.php';

Configuration

  • cachetool (optional): accepts a string with the unix socket or ip address to php-fpm. If cachetool is not given, then the application will look for a cachetool.yml file and read the configuration from there.

    set('cachetool', '/var/run/php-fpm.sock');
    // or
    set('cachetool', '127.0.0.1:9000');

You can also specify different cachetool settings for each host:

host('staging')
->set('cachetool', '127.0.0.1:9000');

host('production')
->set('cachetool', '/var/run/php-fpm.sock');

By default, if no cachetool parameter is provided, this recipe will fallback to the global setting.

If your deployment user does not have permission to access the php-fpm.sock, you can alternatively use the web adapter that creates a temporary php file and makes a web request to it with a configuration like

set('cachetool_args', '--web --web-path=./public --web-url=https://{{hostname}}');

Usage

Since APCu and OPcache deal with compiling and caching files, they should be executed right after the symlink is created for the new release:

after('deploy:symlink', 'cachetool:clear:opcache');
or
after('deploy:symlink', 'cachetool:clear:apcu');

Read more

Read more information about cachetool on the website: http://gordalina.github.io/cachetool/

Configuration

cachetool

Source

cachetool_url

Source

Default value
'https://github.com/gordalina/cachetool/releases/download/7.0.0/cachetool.phar'

cachetool_args

Source

bin/cachetool

Source

cachetool_options

Source

Tasks

cachetool:clear:opcache

Source

Clears OPcode cache.

Clear opcache cache

cachetool:clear:apcu

Source

Clears APCu system cache.

Clear APCU cache

cachetool:clear:stat

Source

Clears file status and realpath caches.

Clear file status cache, including the realpath cache



Support Deployer โค๏ธ

Hello, my name is Anton Medvedev (@antonmedv). I'm the creator of the Deployer. I maintain this open source project in my spare time. Supporters on GitHub give me extra motivation to work on the project.

Consider supporting Deployer via GitHub Sponsors.

Also, please, nominate me for GitHub Stars award. Thanks!