Automattic\WooCommerce\Caching
CacheEngine::cache_object
Caches an object under a given key, and with a given expiration.
Method of the class: CacheEngine{}
No Hooks.
Returns
true|false. True if the object is cached successfully, false otherwise.
Usage
$CacheEngine = new CacheEngine(); $CacheEngine->cache_object( $key, $object, $expiration, $group ): bool;
- $key(string) (required)
- The key under which the object will be cached.
- $object(array|object) (required)
- The object to cache.
- $expiration(int) (required)
- Expiration for the cached object, in seconds.
- $group(string)
- The group under which the object will be cached.
Default:''
CacheEngine::cache_object() CacheEngine::cache object code WC 10.8.1
public function cache_object( string $key, $object, int $expiration, string $group = '' ): bool;