WP-CLI

A command line interface for WordPress

Commands » cache

wp cache - Manage the object cache.

Quick links: Github issues


Use a persistent object cache drop-in to persist cache values between requests.

EXAMPLES

# Set cache.
$ wp cache set my_key my_value my_group 300
Success: Set object 'my_key' in group 'my_group'.

# Get cache.
$ wp cache get my_key my_group
my_value

SUBCOMMANDS

Name Description
add Add a value to the object cache.
decr Decrement a value in the object cache.
delete Remove a value from the object cache.
flush Flush the object cache.
get Get a value from the object cache.
incr Increment a value in the object cache.
replace Replace a value in the object cache, if the value already exists.
set Set a value to the object cache, regardless of whether it already exists.
type Attempts to determine which object cache is being used.