网站首页 / 资讯 / Magento文档/ Magento2.x文档

Magento使用Memcached 缓存数据方法

作者:admin

修改 

app/etc/env.php

添加以下代码

 'cache' => [
        'frontend' => [
            'default' => [
                'backend' => 'Magento\Framework\Cache\Backend\Memcached',
                'backend_options' => [
                    'servers' => [
                        [
                            'host' => '127.0.0.1',
                            'port' => '11211'
                        ]
                    ],
                    'compression' => false
                ]
            ],
            'page_cache' => [
                'backend' => 'Magento\Framework\Cache\Backend\Memcached',
                'backend_options' => [
                    'servers' => [
                        [
                            'host' => '127.0.0.1',
                            'port' => '11211'
                        ]
                    ],
                    'compression' => false
                ]
            ]
        ]
    ],


默认放sesession到DB中

   'session' => [
        'save' => 'db'
    ],

可以修改把session放到memcached中

'session' =>
    array (
      'save' => 'memcached',
      'save_path' => 127.0.0.1:11211'
),


标签: magento2 memcached
上一篇:M2 update on save 与 Update by Schedule 有什么不同
下一篇:没有了

相关内容

最近更新
相关产品
综合服务邮箱: magento2#foxmail.com