cache.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. use think\facade\Env;
  3. // +----------------------------------------------------------------------
  4. // | 缓存设置
  5. // +----------------------------------------------------------------------
  6. return [
  7. // 默认缓存驱动
  8. 'default' => 'redis',
  9. // 缓存连接方式配置
  10. 'stores' => [
  11. 'file' => [
  12. // 驱动方式
  13. 'type' => 'File',
  14. // 缓存保存目录
  15. 'path' => '',
  16. // 缓存前缀
  17. 'prefix' => '',
  18. // 缓存有效期 0表示永久缓存
  19. 'expire' => 0,
  20. // 缓存标签前缀
  21. 'tag_prefix' => 'tag:',
  22. // 序列化机制 例如 ['serialize', 'unserialize']
  23. 'serialize' => [],
  24. ],
  25. // 更多的缓存连接
  26. // redis缓存
  27. 'redis' => [
  28. // 驱动方式
  29. 'type' => 'redis',
  30. // 服务器地址
  31. // 本地
  32. 'host' => '127.0.0.1',
  33. 'password' => '',
  34. 'timeout' =>100,
  35. 'expire'=>0
  36. // 测试
  37. // 'host' => '110.191.166.185',
  38. // 'password' => 'whl123'
  39. ],
  40. ],
  41. ];