Skip to content

Instantly share code, notes, and snippets.

@settermjd
Created October 30, 2015 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save settermjd/3fc3483c35c17576efe0 to your computer and use it in GitHub Desktop.
Save settermjd/3fc3483c35c17576efe0 to your computer and use it in GitHub Desktop.
Cache configuration showing how to configure Zend\Cache to work with Redis.
<?php
if (extension_loaded('redis')) {
return [
'caches' => [
'Cache\Transient' => [
'adapter' => 'redis',
'ttl' => 60,
'plugins' => [
'exception_handler' => [
'throw_exceptions' => true,
],
],
'options' => [
'server' => [
'host' => '127.0.0.1',
'port' => '6379',
],
]
],
'Cache\Persistence' => [
'adapter' => 'filesystem',
'ttl' => 86400,
'options' => [
'cache_dir' => __DIR__ . '/../../data/cache/'
]
],
]
];
} else {
return [];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment