• 欢迎 游客 您的光临,下载之前请先阅读 积分规则 。任何技术问题请在论坛提问,本站定制插件、模板主题。售前、售后问题请联系QQ:5916171
    本站自由发布资源可赚取积分及人民币(可提现)(保证资源真实可用,如被举报封号处理。谨慎分布)。
  • 即日起发表主题、回帖、发布&更新资源、创建&回复私信、发布&回复个人动态均需要验证手机号码,其它不受影响。如不便可进群提问。点击链接加入群聊【XenForo讨论社区】:群号1:143277648

已解决 PHP的各种缓存该如何添加?

香草大叔

联合国秘书长
UID
48
注册
2017/11/27
消息
71
黄金
6,435G
如图所示,我想添加redis和Memcached 缓存
1565500428765.png
但是不知道该如何操作,有没有文档,或者大家交流一下
 
服务器安装redis php扩展安装redis
然后安装 Redis Cache 插件 https://www.cnxfans.com/resources/178/
修改配置文件src/congfig.php

末尾加入

PHP:
扩展 折叠 复制
// setup redis caching
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
// all keys and their defaults
$config['cache']['config'] = array(
        'server' => '127.0.0.1',
        'port' => 6379,
        'timeout' => 2.5,
        'persistent' => null,
        'force_standalone' => false,
        'connect_retries' => 1,
        'read_timeout' => null,
        'password' => null,
        'database' => 0,
        'compress_data' => 1,
        'lifetimelimit' => 2592000,
        'compress_threshold' => 20480,
        'compression_lib' => null, // dynamically select first of; snappy,lzf,l4z,gzip IF EMPTY/null
        'use_lua' => true,
        'serializer' => 'igbinary', // to disable set ot 'php'
        'retry_reads_on_master' => false,
        // HA support
        'load_from_slave' => null, // config entry similar to $config['cache']['config'], except without HA options
        'load_from_slaves' => null, // config entry similar to $config['cache']['config'], except without HA options
        'sentinel_master_set' => null,
        'sentinel_persistent' => null,
        );
// single slave (has most of the details of config):
$config['cache']['config']['load_from_slave'] = array(
        'server' => '127.0.0.1',
        'port' => 6378,
        );

// minimal case for sentinel support (aka HA)
$config['cache']['config']['sentinel_master_set'] = 'mymaster';
$config['cache']['config']['server'] = '127.0.0.1:26379';
$config['cache']['config']['load_from_slaves'] = false; // send readonly queries to the slaves
$config['cache']['config']['sentinel_persistent'] = null; // persistent connection option for the sentinel, but not the master/slave

// minimal case
$config['cache']['config'] = array(
        'server' => '127.0.0.1',
        'port' => 6379,
        );
$config['pageCache']['enabled'] = true;


我是这样添加的,如有其它欢迎讨论。
 
后退
顶部 底部