How to Use ZiziCache WP-CLI Commands?

Updated on 10. 2. 2026



How to Use ZiziCache WP-CLI Commands

This page documents the actual WP-CLI commands implemented by the ZiziCache plugin. All commands are available under the wp zizi-cache namespace and reflect the current behavior in the plugin code.

Prerequisites

  • WP-CLI installed and available on the server.
  • ZiziCache plugin active in WordPress.
  • Run from WordPress root (the directory containing wp-config.php).
  • Writable cache directory: wp-content/cache must be writable for most commands.

Tip: running wp zizi-cache without arguments prints the built-in command list.

Cache Management (Page Cache)

These commands manage the file-based page cache. They do not accept URL arguments in the current CLI implementation.

  • wp zizi-cache preload-cache — preloads the page cache. This forces preloading even if the preload setting is disabled in the UI.
  • wp zizi-cache purge-pages — purges all cached HTML pages (not per-URL).
  • wp zizi-cache purge-pages-and-preload — purges all cached HTML pages and immediately starts preload.
  • wp zizi-cache purge-everything — deletes the entire cache directory (pages, optimized assets, fonts, etc.) and re-creates security files.
  • wp zizi-cache purge-everything-and-preload — full purge followed by preload.

Note: Selective URL purge is not available via CLI in this version.

Object Cache

These commands call wp_cache_flush(), so they work with the active object cache backend (Redis or Memcached). If the function is not available, a warning is shown.

  • wp zizi-cache redis-flush
  • wp zizi-cache object-cache-flush (alias)

PHP OPcache

OPcache commands are provided in two styles. Use any of the following:

  • wp zizi-cache opcache-flush (alias: wp zizi-cache opcache/flush)
  • wp zizi-cache opcache flush
  • wp zizi-cache opcache stats

Notes:

  • Flush may fail if the Zend OPcache extension is not loaded.
  • If opcache.restrict_api is set, flush is blocked outside allowed addresses.
  • opcache stats prints a structured array (memory, hit rate, cached scripts, etc.).

Quicklink (Speculative Prefetch)

ZiziCache exposes Quicklink toggles and configuration via CLI. These commands update the plugin configuration directly.

  • wp zizi-cache quicklink-enable
    • Options: --mode=prefetch|prerender|both
    • --conditional=true with --page-types=home,front_page,singular,archive,search
  • wp zizi-cache quicklink-disable
  • wp zizi-cache quicklink-status — prints current configuration and warns about overlap with Speculation Rules if both are enabled.
  • wp zizi-cache quicklink-configure
    • --mode=prefetch|prerender|both
    • --throttle= (concurrent requests)
    • --limit= (total requests)
    • --delay=
    • --timeout=
    • --threshold=0-100
    • --priority=true|false
    • --respect-data-saver=true|false
    • --min-connection=5g|4g|3g|any
    • --block-ads=true|false
    • --conditional=true|false
    • --page-types=home,front_page,singular,archive,search
    • --origins=example.com,example.org (hostnames only)
    • --ignores=/api/*,*.pdf,/logout

Validation rules: invalid modes fall back to prefetch; invalid min-connection falls back to 3g. If conditional mode is enabled without valid page types, conditional mode is disabled.

License

  • wp zizi-cache activate-license — activates a license key.

Examples

# Show the built-in command list
wp zizi-cache

# Full cache purge and preload
wp zizi-cache purge-everything-and-preload

# Flush object cache (Redis or Memcached)
wp zizi-cache object-cache-flush

# Flush OPcache and view stats
wp zizi-cache opcache flush
wp zizi-cache opcache stats

# Enable Quicklink in prefetch mode only for posts/pages
wp zizi-cache quicklink-enable --mode=prefetch --conditional=true --page-types=singular

# Configure Quicklink limits
wp zizi-cache quicklink-configure --throttle=3 --limit=10 --delay=100 --timeout=2000

Troubleshooting

  • Command not found: ensure the plugin is active and you are in the WordPress root.
  • Permission error: verify wp-content/cache is writable.
  • OPcache flush fails: check OPcache extension and opcache.restrict_api.
What are your feelings