php Magento 2的Redis配置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php Magento 2的Redis配置相关的知识,希望对你有一定的参考价值。

    'cache' => array(
        'frontend' => array(
            'default' => array(
                'backend' => 'Cm_Cache_Backend_Redis',
                'backend_options' => array(
                    'server' => 'localhost',
                    'port' => '6379',
                    'persistent' => '',
                    'database' => '0',
                    'force_standalone' => '0',
                    'connect_retries' => '1',
                    'read_timeout' => '10',
                    'automatic_cleaning_factor' => '0',
                    'compress_data' => '1',
                    'compress_tags' => '1',
                    'compress_threshold' => '20480',
                    'compression_lib' => 'gzip',
                    'use_lua' => '0',
                ),
            ),
            'page_cache' => array(
                'backend' => 'Cm_Cache_Backend_Redis',
                'backend_options' => array(
                    'server' => 'localhost',
                    'port' => '6379',
                    'persistent' => '',
                    'database' => '1',
                    'force_standalone' => '0',
                    'connect_retries' => '1',
                    'read_timeout' => '10',
                    'automatic_cleaning_factor' => '0',
                    'compress_data' => '0',
                    'compress_tags' => '1',
                    'compress_threshold' => '20480',
                    'compression_lib' => 'gzip',
                    'lifetimelimit' => '57600',
                ),
            ),
        ),
    ),

    'cache' => [
        'frontend' => [
            'default' => [
                'backend' => 'Cm_Cache_Backend_Redis',
                'backend_options' => [
                    'server' => 'localhost',
                    'port' => '6379',
                    'persistent' => '',
                    'database' => '0',
                    'force_standalone' => '0',
                    'connect_retries' => '1',
                    'read_timeout' => '10',
                    'automatic_cleaning_factor' => '0',
                    'compress_data' => '1',
                    'compress_tags' => '1',
                    'compress_threshold' => '20480',
                    'compression_lib' => 'gzip',
                    'use_lua' => '0'
                ]
            ],
            'page_cache' => [
                'backend' => 'Cm_Cache_Backend_Redis',
                'backend_options' => [
                    'server' => 'localhost',
                    'port' => '6379',
                    'persistent' => '',
                    'database' => '1',
                    'force_standalone' => '0',
                    'connect_retries' => '1',
                    'read_timeout' => '10',
                    'automatic_cleaning_factor' => '0',
                    'compress_data' => '0',
                    'compress_tags' => '1',
                    'compress_threshold' => '20480',
                    'compression_lib' => 'gzip',
                    'lifetimelimit' => '57600'
                ]
            ]
        ]
    ],

以上是关于php Magento 2的Redis配置的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf 配置redis会话#magento(local.xml)

php Magento - 可配置产品检查

php Magento - 可配置产品检查

php 打印Magento配置树

国外最火的电商网站magento2:系列

Magento2使用Redis进行页面缓存或会话存储。