cache.php 3.5 KB

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