微擎开启redis memcache文档2

时间:2021-11-08 12:51:24

微擎开启redis memcache

2018年01月20日 14:39:54 luogan129 阅读数:2161更多
个人分类: 微信开发
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/luogan129/article/details/79114116

config.php

// --------------------------  CONFIG SETTING  --------------------------- //
$config['setting']['charset'] = 'utf-8';
$config['setting']['cache'] = 'redis';
$config['setting']['timezone'] = 'Asia/Shanghai';
  • 1
  • 2
  • 3
  • 4
// --------------------------  CONFIG MEMCACHE  --------------------------- //
$config['setting']['memcache']['server'] = '127.0.0.1';
$config['setting']['memcache']['port'] = 11211;
$config['setting']['memcache']['pconnect'] = 1;
$config['setting']['memcache']['timeout'] = 30;
$config['setting']['memcache']['session'] = 1; // -------------------------- CONFIG REDIS --------------------------- //
$config['setting']['redis']['server'] = '127.0.0.1';//如果redis服务器在别的机器,请填写机器的IP地址。
$config['setting']['redis']['port'] = 6379;
$config['setting']['redis']['pconnect'] = 0;
$config['setting']['redis']['timeout'] = 1;
$config['setting']['redis']['requirepass'] = '';
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

选redis还是memcache,源码怎么说? - regean的博客

memcache和redis是互联网分层架构中,最常用的KV缓存。不少同学在选型的时候会纠结,到底是选择memcache还是redis。画外音:不鼓励粗暴的实践,例如“memcache提供的功能是re...