cache.php 3.2 KB

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