Skip to the content
Documentation

exp:cache

No ratings yet

Available since Exponential 6.0.15 (in development, not in a release yet).

Summary

Clear and inspect caches by tag, id or all: content, static, HTTP, Velocity, OPcache, APCu

Usage

./console exp:cache [options]
php bin/php/cache.php [options]

Help

The output of ./console help exp:cache (the script run with --help), without the standard options:

Usage: bin/php/cache.php [OPTION]... [GROUP] [ACTION]
Exponential cache control: every Setup > Cache action from the command line

Usage: exp:cache <group> [action] [options]      (php bin/php/cache.php ...)

Groups:
  list         list [--sizes]
  tags         tags
  status       status
  clear        clear --all | --tag=<t>[,<t>] | --id=<id>[,<id>] [--purge [--expiry=<when>]]
  content      content
  template     template
  ini          ini
  all          all
  imagealias   imagealias [clear|purge]
  static       static status|regenerate|clear [--site=<siteaccess>] [--path=<p>[,<p>]] [--node=<id>[,<id>]]
  httpcache    httpcache status|clear|purge|gc|reset-stats [--url=<u>] [--node=<id>] [--tag=<t>]
  querycache   querycache status|clear
  velocity     velocity status|clear
  precompress  precompress status|clear
  opcache      opcache status|reset
  apcu         apcu status|clear

Options for every group:
  --dry-run      list what would be cleared, change nothing
  --json         one JSON object: ok, message, items, dry_run, data
  --siteaccess=<name>  the siteaccess whose settings and var directory are used
  --allow-root-user    required when run as root, as for every script

Output ends with PASS or FAIL. Exit codes: 0 done, 1 failed, 2 usage error.
exp:cache <group> --help (or exp:cache help <group>) explains a group.


Options:
  --dry-run                List what would be cleared and change nothing
  --json                   Report as one JSON object
  --all                    clear: every cache
  --tag=VALUE              clear: caches with these tags (comma separated); httpcache purge: these HTTP cache tags
  --id=VALUE               clear: caches with these ids (comma separated)
  --purge                  clear, imagealias: remove the entries for real
  --expiry=VALUE           with --purge: only entries older than this, e.g. "-2 days"
  --iteration-sleep=VALUE  with --purge: seconds to sleep between iterations
  --iteration-max=VALUE    with --purge: entries per iteration
  --sizes                  list: count the files and bytes of each cache
  --site=VALUE             static: the siteaccess to generate or clear (default every cacheable one)
  --path=VALUE             static: pages relative to the site, comma separated
  --node=VALUE             static, httpcache purge: node ids, comma separated
  --url=VALUE              httpcache purge: urls, comma separated
  --max-pages=VALUE        static regenerate: stop after this many pages per site (default 2500)
  --max-depth=VALUE        static regenerate: follow links this many steps (default 12)
  --keep                   static regenerate: add to what is stored instead of replacing it

Options

Option Value Description
--dry-run - List what would be cleared and change nothing
--json - Report as one JSON object
--all - clear: every cache
--tag required clear: caches with these tags (comma separated); httpcache purge: these HTTP cache tags
--id required clear: caches with these ids (comma separated)
--purge - clear, imagealias: remove the entries for real
--expiry required with --purge: only entries older than this, e.g. "-2 days"
--iteration-sleep required with --purge: seconds to sleep between iterations
--iteration-max required with --purge: entries per iteration
--sizes - list: count the files and bytes of each cache
--site required static: the siteaccess to generate or clear (default every cacheable one)
--path required static: pages relative to the site, comma separated
--node required static, httpcache purge: node ids, comma separated
--url required httpcache purge: urls, comma separated
--max-pages required static regenerate: stop after this many pages per site (default 2500)
--max-depth required static regenerate: follow links this many steps (default 12)
--keep - static regenerate: add to what is stored instead of replacing it

Arguments

[group][action]

Standard options

Every script also takes the standard options of the script framework: --help, --quiet, --siteaccess, --debug, --colors, --no-colors, --logfiles, --no-logfiles, --verbose and --allow-root-user.

Source

bin/php/cache.php, kernel/private/classes/commands/cache.php

See also

Generated example: exp:cache

Added to the reference for Exponential 6.0.15.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.