Application Caching

Caching Methods

$app->getCaching()

Accessing cache service.

/** @var \Zend\Cache\Storage\StorageInterface $cache */
$cache = $app->getCache();

$app->getCache()

Getting cached value.

$myValue = $app->getCache('myCacheKey');

$app->setCache()

Setting value to cache.

$app->setCache('myCacheKey', $myValue);

Cache Config

ConfigCacheEnabled

Toggling application config caching.

use WebinoAppLib\Feature\Config;
use WebinoConfigLib\Feature\ConfigCacheEnabled;

new Config([
    // enable
    new ConfigCacheEnabled,
    // disable
    new ConfigCacheEnabled(false),
]);

See also

Caching Methods

FilesystemCache

Configuring filesystem cache.

use WebinoAppLib\Application\CoreConfig;
use WebinoAppLib\Feature\FilesystemCache;

new CoreConfig([
    new FilesystemCache,
]);

MemoryCache

Configuring in memory cache.

use WebinoAppLib\Application\CoreConfig;
use WebinoAppLib\Feature\MemoryCache;

new CoreConfig([
    new MemoryCache,
]);