1
0

cache.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 缓存设置
  4. // +----------------------------------------------------------------------
  5. return [
  6. // 默认缓存驱动
  7. 'default' => env('cache.driver', 'file'),
  8. // 缓存连接方式配置
  9. 'stores' => [
  10. 'file' => [
  11. // 驱动方式
  12. 'type' => 'File',
  13. // 缓存保存目录
  14. 'path' => '',
  15. // 缓存前缀
  16. 'prefix' => '',
  17. // 缓存有效期 0表示永久缓存
  18. 'expire' => 0,
  19. // 缓存标签前缀
  20. 'tag_prefix' => 'tag:',
  21. // 序列化机制 例如 ['serialize', 'unserialize']
  22. 'serialize' => [],
  23. ],
  24. 'redis' => [
  25. 'type' => 'redis',
  26. // 连接地址
  27. 'host' => env('cache.host'),
  28. // 端口号
  29. 'port' => env('cache.port'),
  30. // redis配置的密码,如果没有则留空
  31. 'password' => env('cache.password'),
  32. // 缓存时间
  33. 'timeout' => env('cache.timeout'),
  34. // 节点
  35. 'select' => env('cache.select'),
  36. // 全局缓存有效期(0为永久有效)
  37. 'expire'=> env('cache.expire'),
  38. ],
  39. // 更多的缓存连接
  40. ],
  41. ];