Skip to content

[V5˖] Disabling PhpFastCache

Georges.L edited this page Jun 23, 2022 · 2 revisions

Sometimes you may need to disable PhpFastCache for some reasons.

As of the V5 there's no "on/off" setting anymore, but you can use Devnull driver instead:

use phpFastCache\CacheManager;

CacheManager::getInstance('Devnull', $config);
// An alternative exists:
CacheManager::Devnull($config);

This driver is a development driver and will always return "empty" item, forcing your code to fetch data from source instead of pulling them from cache.

Clone this wiki locally