cache.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. use Illuminate\Support\Str;
  3. return [
  4. 'expirations'=>[
  5. 'default'=>20, //默认
  6. 'fastChange'=>3, //很快改
  7. 'oftenChange'=>15, //经常改
  8. 'rarelyChange'=>260, //几乎不变
  9. 'commonFrequent'=>200, //一般频率
  10. 'forever' =>null, //永久
  11. 'serviceAutoCache'=>300, //服务中自动缓存
  12. 'owners'=>20, //模型Owner
  13. 'orderCountingRecord'=>1800, //模型Owner
  14. 'logisticsCountingRecords'=>1800, //快递饼图缓存时间
  15. 'warehouseCountingRecords'=>1800, //仓库饼图缓存时间
  16. ],
  17. /*
  18. |--------------------------------------------------------------------------
  19. | Default Cache Store
  20. |--------------------------------------------------------------------------
  21. |
  22. | This option controls the default cache connection that gets used while
  23. | using this caching library. This connection is used when another is
  24. | not explicitly specified when executing a given caching function.
  25. |
  26. | Supported: "apc", "array", "database", "file",
  27. | "memcached", "redis", "dynamodb"
  28. |
  29. */
  30. 'default' => env('CACHE_DRIVER', 'file'),
  31. /*
  32. |--------------------------------------------------------------------------
  33. | Cache Stores
  34. |--------------------------------------------------------------------------
  35. |
  36. | Here you may define all of the cache "stores" for your application as
  37. | well as their drivers. You may even define multiple stores for the
  38. | same cache driver to group types of items stored in your caches.
  39. |
  40. */
  41. 'stores' => [
  42. 'apc' => [
  43. 'driver' => 'apc',
  44. ],
  45. 'array' => [
  46. 'driver' => 'array',
  47. ],
  48. 'database' => [
  49. 'driver' => 'database',
  50. 'table' => 'cache',
  51. 'connection' => null,
  52. ],
  53. 'file' => [
  54. 'driver' => 'file',
  55. 'path' => storage_path('framework/cache/data'),
  56. ],
  57. 'memcached' => [
  58. 'driver' => 'memcached',
  59. 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
  60. 'sasl' => [
  61. env('MEMCACHED_USERNAME'),
  62. env('MEMCACHED_PASSWORD'),
  63. ],
  64. 'options' => [
  65. // Memcached::OPT_CONNECT_TIMEOUT => 2000,
  66. ],
  67. 'servers' => [
  68. [
  69. 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
  70. 'port' => env('MEMCACHED_PORT', 11211),
  71. 'weight' => 100,
  72. ],
  73. ],
  74. ],
  75. 'redis' => [
  76. 'driver' => 'redis',
  77. 'connection' => 'cache',
  78. ],
  79. 'dynamodb' => [
  80. 'driver' => 'dynamodb',
  81. 'key' => env('AWS_ACCESS_KEY_ID'),
  82. 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  83. 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
  84. 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
  85. 'endpoint' => env('DYNAMODB_ENDPOINT'),
  86. ],
  87. ],
  88. /*
  89. |--------------------------------------------------------------------------
  90. | Cache Key Prefix
  91. |--------------------------------------------------------------------------
  92. |
  93. | When utilizing a RAM based store such as APC or Memcached, there might
  94. | be other applications utilizing the same cache. So, we'll specify a
  95. | value to get prefixed to all our keys so we can avoid collisions.
  96. |
  97. */
  98. 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
  99. ];