Deprecated. The WinCache extension is unmaintained and is not available for PHP 8. This handler is kept only for backward compatibility. On modern stacks use File, Redis or Memcache(d) instead.
InitPHP\Cache\Handler\Wincache stores items in the WinCache user cache
(ext-wincache, Windows only).
| Option | Type | Default | Description |
|---|---|---|---|
prefix |
string |
cache_ |
Prepended to keys. |
default_ttl |
int |
0 |
Expiry used when set() is called with no TTL. 0 means "no expiry". |
use InitPHP\Cache\Cache;
use InitPHP\Cache\Handler\Wincache;
$cache = Cache::create(Wincache::class, [
'default_ttl' => 300,
]);
$cache->set('key', 'value', 60);
$cache->get('key');- Values are stored with
wincache_ucache_set(); TTLs are delegated to WinCache. clear()callswincache_ucache_clear(), clearing the entire user cache.
If the WinCache extension is not loaded, or wincache.ucenabled is off,
constructing the handler throws a CacheException.