Skip to main content

cache:clear:etag

Expires every cached ETag value stored in Redis, forcing the API to recompute conditional-request responses (If-None-Match / 304 Not Modified checks) from scratch instead of relying on previously cached ETags.

Takes no arguments or options. It scans Redis for all keys matching etag:* and expires them immediately; it does not touch any other cached data. Use this after changes that could make existing ETags stale in a way the application itself doesn’t detect - for example after directly editing data in the underlying databases outside of the API.

Help

php bin/console cache:clear:etag --help
Description:
  Removes all cached etag values from Redis.

Usage:
  cache:clear:etag

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
      --silent          Do not output any message
  -q, --quiet           Only errors are displayed. All other output is suppressed
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -e, --env=ENV         The Environment name. [default: "prod"]
      --no-debug        Switch off debug mode.
      --profile         Enables profiling (requires debug).
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Example

php bin/console cache:clear:etag -f
    ▄
  ▄▀ ▀▄  Ember Nexus API
   ▀█▀   v0.1.31, production mode

  Cache Clear Etag

  Expiring Etags iteratively...
  .
  Expired 0 etags.

▶ Successfully expired all Etags.