cache.php 3.4 KB

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