缓存

缓存

系统默认采用文件缓存,可以改为 redis 缓存,修改 config/cache.php 配置 'default' => 'redis'

  1. return [
  2. 'default' => 'file',
  3. 'adapters' => [
  4. 'file' => [
  5. 'handler' => function() {
  6. return new FilesystemAdapter('', 0, runtime_path() . DS . 'cache');
  7. }
  8. ],
  9. 'redis' => [
  10. 'handler' => function() {
  11. return new RedisAdapter(Redis::connection()->client());
  12. }
  13. ]
  14. ]
  15. ];