cache.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. return [
  3. // 默认缓存驱动
  4. 'default' => 'redis',
  5. // 缓存连接配置
  6. 'stores' => [
  7. 'file' => [
  8. // 驱动方式
  9. 'type' => 'File',
  10. // 缓存保存目录
  11. 'path' => '',
  12. // 缓存名称前缀
  13. 'prefix' => '',
  14. // 缓存有效期 0 表示永久缓存
  15. 'expire' => 15552000,
  16. // 缓存标签前缀
  17. 'tag_prefix' => 'tag:',
  18. // 序列化机制
  19. 'serialize' => [],
  20. ],
  21. // 配置Reids
  22. 'redis' => [
  23. 'type' => 'redis',
  24. 'host' => env('redis.host', '127.0.0.1'),
  25. 'port' => env('redis.port', '6379'),
  26. 'password' => env('redis.pass', ''),
  27. 'select' => env('redis.db', '0'),
  28. // 全局缓存有效期(0为永久有效)
  29. 'expire' => 15552000,
  30. // 缓存前缀
  31. 'prefix' => 'wbm:',
  32. 'timeout' => 0,
  33. ],
  34. ],
  35. ];