1
0

cache.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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' => 'la',
  17. // 缓存有效期 0表示永久缓存
  18. 'expire' => 0,
  19. // 缓存标签前缀
  20. 'tag_prefix' => 'tag:',
  21. // 序列化机制 例如 ['serialize', 'unserialize']
  22. 'serialize' => [],
  23. ],
  24. // redis缓存
  25. 'redis' => [
  26. // 驱动方式
  27. 'type' => 'redis',
  28. // 服务器地址
  29. 'host' => env('cache.host','127.0.0.1'),
  30. // 端口
  31. 'port' => env('cache.port','6379'),
  32. // 密码
  33. 'password' => env('cache.password', ''),
  34. // 缓存前缀
  35. 'prefix' => 'la:',
  36. ],
  37. // redis缓存
  38. 'common_redis' => [
  39. // 驱动方式
  40. 'type' => 'redis',
  41. // 服务器地址
  42. 'host' => env('cache.host','127.0.0.1'),
  43. // 端口
  44. 'port' => env('cache.port','6379'),
  45. // 密码
  46. 'password' => env('cache.password', ''),
  47. // 缓存前缀
  48. 'prefix' => env('cache.common_prefix', 'common:'),
  49. ],
  50. ],
  51. ];