Skip to content

Instantly share code, notes, and snippets.

@DragonBe
Created February 2, 2017 19:32
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 DragonBe/4b62807197847e33499fb2b851bfad50 to your computer and use it in GitHub Desktop.
Save DragonBe/4b62807197847e33499fb2b851bfad50 to your computer and use it in GitHub Desktop.
Zend Framework configuration for Redis cache
<?php
return [
'caches' => [
'cache_longterm' => [
'adapter' => \Zend\Cache\Storage\Adapter\Redis::class,
'options' => [
'server' => [
'host' => getenv('APP_REDIS_HOST'),
'port' => getenv('APP_REDIS_PORT'),
],
'password' => getenv('APP_REDIS_AUTH'),
'lib_options' => [
Redis::OPT_SERIALIZER => Redis::SERIALIZER_PHP,
],
],
'ttl' => 86400, //Cache for 24hrs
'plugins' => [
'exception_handler' => [
'throw_exceptions' => false,
],
],
],
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment