cache.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?php
  2. use Illuminate\Support\Str;
  3. return [
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Default Cache Store
  7. |--------------------------------------------------------------------------
  8. |
  9. | This option controls the default cache store that will be used by the
  10. | framework. This connection is utilized if another isn't explicitly
  11. | specified when running a cache operation inside the application.
  12. |
  13. */
  14. 'default' => env('CACHE_STORE', 'database'),
  15. /*
  16. |--------------------------------------------------------------------------
  17. | Cache Stores
  18. |--------------------------------------------------------------------------
  19. |
  20. | Here you may define all of the cache "stores" for your application as
  21. | well as their drivers. You may even define multiple stores for the
  22. | same cache driver to group types of items stored in your caches.
  23. |
  24. | Supported drivers: "array", "database", "file", "memcached",
  25. | "redis", "dynamodb", "octane", "session",
  26. | "failover", "null"
  27. |
  28. */
  29. 'stores' => [
  30. 'array' => [
  31. 'driver' => 'array',
  32. 'serialize' => false,
  33. ],
  34. 'session' => [
  35. 'driver' => 'session',
  36. 'key' => env('SESSION_CACHE_KEY', '_cache'),
  37. ],
  38. 'database' => [
  39. 'driver' => 'database',
  40. 'connection' => env('DB_CACHE_CONNECTION'),
  41. 'table' => env('DB_CACHE_TABLE', 'cache'),
  42. 'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
  43. 'lock_table' => env('DB_CACHE_LOCK_TABLE'),
  44. ],
  45. 'file' => [
  46. 'driver' => 'file',
  47. 'path' => storage_path('framework/cache/data'),
  48. 'lock_path' => storage_path('framework/cache/data'),
  49. ],
  50. 'memcached' => [
  51. 'driver' => 'memcached',
  52. 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
  53. 'sasl' => [
  54. env('MEMCACHED_USERNAME'),
  55. env('MEMCACHED_PASSWORD'),
  56. ],
  57. 'options' => [
  58. // Memcached::OPT_CONNECT_TIMEOUT => 2000,
  59. ],
  60. 'servers' => [
  61. [
  62. 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
  63. 'port' => env('MEMCACHED_PORT', 11211),
  64. 'weight' => 100,
  65. ],
  66. ],
  67. ],
  68. 'redis' => [
  69. 'driver' => 'redis',
  70. 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
  71. 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
  72. ],
  73. 'dynamodb' => [
  74. 'driver' => 'dynamodb',
  75. 'key' => env('AWS_ACCESS_KEY_ID'),
  76. 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  77. 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
  78. 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
  79. 'endpoint' => env('DYNAMODB_ENDPOINT'),
  80. ],
  81. 'octane' => [
  82. 'driver' => 'octane',
  83. ],
  84. 'failover' => [
  85. 'driver' => 'failover',
  86. 'stores' => [
  87. 'database',
  88. 'array',
  89. ],
  90. ],
  91. ],
  92. /*
  93. |--------------------------------------------------------------------------
  94. | Cache Key Prefix
  95. |--------------------------------------------------------------------------
  96. |
  97. | When utilizing the APC, database, memcached, Redis, and DynamoDB cache
  98. | stores, there might be other applications using the same cache. For
  99. | that reason, you may prefix every cache key to avoid collisions.
  100. |
  101. */
  102. 'prefix' => env('CACHE_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-cache-'),
  103. ];