cache.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Default Cache Store
  6. |--------------------------------------------------------------------------
  7. |
  8. | This option controls the default cache connection that gets used while
  9. | using this caching library. This connection is used when another is
  10. | not explicitly specified when executing a given caching function.
  11. |
  12. */
  13. 'default' => env('CACHE_DRIVER', 'redis'),
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Cache Stores
  17. |--------------------------------------------------------------------------
  18. |
  19. | Here you may define all of the cache "stores" for your application as
  20. | well as their drivers. You may even define multiple stores for the
  21. | same cache driver to group types of items stored in your caches.
  22. |
  23. */
  24. 'stores' => [
  25. 'apc' => [
  26. 'driver' => 'apc',
  27. ],
  28. 'array' => [
  29. 'driver' => 'array',
  30. ],
  31. 'database' => [
  32. 'driver' => 'database',
  33. 'table' => env('CACHE_DATABASE_TABLE', 'cache'),
  34. 'connection' => env('CACHE_DATABASE_CONNECTION', null),
  35. ],
  36. 'file' => [
  37. 'driver' => 'file',
  38. 'path' => storage_path('framework/cache'),
  39. ],
  40. 'memcached' => [
  41. 'driver' => 'memcached',
  42. 'servers' => [
  43. [
  44. 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 'port' => env('MEMCACHED_PORT', 11211), 'weight' => 100,
  45. ],
  46. ],
  47. ],
  48. 'redis' => [
  49. 'driver' => 'redis',
  50. 'connection' => env('CACHE_REDIS_CONNECTION', 'default'),
  51. ],
  52. ],
  53. /*
  54. |--------------------------------------------------------------------------
  55. | Cache Key Prefix
  56. |--------------------------------------------------------------------------
  57. |
  58. | When utilizing a RAM based store such as APC or Memcached, there might
  59. | be other applications utilizing the same cache. So, we'll specify a
  60. | value to get prefixed to all our keys so we can avoid collisions.
  61. |
  62. */
  63. 'prefix' => env('CACHE_PREFIX', 'matchexpo:'),
  64. /**
  65. * 字段缓存时间
  66. */
  67. 'columns' => env('CACHE_COLUMNS',3600),
  68. /**
  69. * 数据缓存时间
  70. */
  71. 'time' => env('CACHE_TIME',3600),
  72. /**
  73. * 较短的缓存时间
  74. */
  75. 'short_time' => env('SHORT_CACHE_TIME', 300),
  76. /**
  77. * token缓存时间, 单位秒
  78. */
  79. 'token' => env('TOKEN_TIME',3600),
  80. 'api_token' => env('TOKEN_TIME',3600),
  81. 'sms_time'=>env('SMS_TIME',1800), //30分钟
  82. 'email_time'=>env('EMAIL_TIME',3600), //一小时
  83. 'def_time'=>env('DEF_TIME',60*60*24), //一天
  84. 'api_token_expire_time'=>env('TOKEN_EXPIRE_TIME',60*60*2), //2*60*60小时(秒)token缓存时间
  85. 'api_token_long_expire_time'=>env('TOKEN_EXPIRE_TIME',60*60*24*30), //30*24小时(秒)token缓存时间
  86. //表单缓存时间
  87. 'form_cache_time' => env('FORM_CACHE_TIME', 7*24*60),
  88. //订单缓存时间
  89. 'order_expire_time' => env('ORDER_EXPIRE_TIME', 30),
  90. 'heart_beat_time' => env('TOKEN_EXPIRE_TIME', 60 * 30), //7*24小时(秒)token缓存时间
  91. ];