Skip to content

Instantly share code, notes, and snippets.

@VirtuBox
Created May 8, 2017 22:31
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save VirtuBox/54d527531eb2d91d5c92fea99345d34a to your computer and use it in GitHub Desktop.
Save VirtuBox/54d527531eb2d91d5c92fea99345d34a to your computer and use it in GitHub Desktop.
env.php configuration example for magento 2.1 with redis cache
<?php
return array (
'backend' =>
array (
'frontName' => 'youradmin-url',
),
'crypt' =>
array (
'key' => 'thelongkey',
),
'session' =>
array (
'save' => 'redis',
'redis' =>
array (
'host' => '127.0.0.1',
'port' => '6379',
'password' => '',
'timeout' => '2.5',
'persistent_identifier' => 'magento2:',
'database' => '1',
'compression_threshold' => '2048',
'compression_library' => 'gzip',
'log_level' => '1',
'max_concurrency' => '6',
'break_after_frontend' => '5',
'break_after_adminhtml' => '30',
'first_lifetime' => '600',
'bot_first_lifetime' => '60',
'bot_lifetime' => '7200',
'disable_locking' => '0',
'min_lifetime' => '60',
'max_lifetime' => '2592000',
),
),
'db' =>
array (
'table_prefix' => '',
'connection' =>
array (
'default' =>
array (
'host' => 'localhost:3306',
'dbname' => 'magento',
'username' => 'magento',
'password' => 'magento',
'model' => 'mysql4',
'engine' => 'innodb',
'initStatements' => 'SET NAMES utf8;',
'active' => '1',
),
),
),
'resource' =>
array (
'default_setup' =>
array (
'connection' => 'default',
),
),
'x-frame-options' => 'SAMEORIGIN',
'MAGE_MODE' => 'default',
'cache_types' =>
array (
'config' => 1,
'layout' => 1,
'block_html' => 1,
'collections' => 1,
'reflection' => 1,
'db_ddl' => 1,
'eav' => 1,
'customer_notification' => 1,
'full_page' => 1,
'config_integration' => 1,
'config_integration_api' => 1,
'translate' => 1,
'config_webservice' => 1,
),
'install' =>
array (
'date' => 'Sat, 09 Jul 2016 20:30:32 +0000',
),
'cache' =>
array(
'frontend' =>
array(
'default' =>
array(
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' =>
array(
'server' => '127.0.0.1',
'port' => '6379',
),
),
'page_cache' =>
array(
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' =>
array(
'server' => '127.0.0.1',
'port' => '6379',
'database' => '2',
'compress_data' => '0',
),
),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment