Skip to content

[V5˖] Disabling PhpFastCache

Georges.L edited this page Nov 18, 2016 · 2 revisions

Sometimes you may need to disable PhpFastCache for some reasons.

As of the V5 there's not "on/off" setting anymore, 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