缓存配置


设置配置项

配置文件路径:

  1. config/{环境}/common.config.php
  2. app/{应用}/config.php

两个里面都可以配置,只需增加一个配置项(cache)即可

例子:

Redis作为缓存

  1. return [
  2. 'cache' => [
  3. 'type' => 'Redis',
  4. 'host' => '127.0.0.1',
  5. 'port' => 6379,
  6. 'timeout' => 3,
  7. 'db' => 6
  8. ]
  9. ];