cache.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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: "apc", "array", "database", "file", "memcached",
  25. | "redis", "dynamodb", "octane", "null"
  26. |
  27. */
  28. 'stores' => [
  29. 'array' => [
  30. 'driver' => 'array',
  31. 'serialize' => false,
  32. ],
  33. 'database' => [
  34. 'driver' => 'database',
  35. 'table' => env('DB_CACHE_TABLE', 'cache'),
  36. 'connection' => env('DB_CACHE_CONNECTION'),
  37. 'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
  38. ],
  39. 'file' => [
  40. 'driver' => 'file',
  41. 'path' => storage_path('framework/cache/data'),
  42. 'lock_path' => storage_path('framework/cache/data'),
  43. ],
  44. 'memcached' => [
  45. 'driver' => 'memcached',
  46. 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
  47. 'sasl' => [
  48. env('MEMCACHED_USERNAME'),
  49. env('MEMCACHED_PASSWORD'),
  50. ],
  51. 'options' => [
  52. // Memcached::OPT_CONNECT_TIMEOUT => 2000,
  53. ],
  54. 'servers' => [
  55. [
  56. 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
  57. 'port' => env('MEMCACHED_PORT', 11211),
  58. 'weight' => 100,
  59. ],
  60. ],
  61. ],
  62. 'redis' => [
  63. 'driver' => 'redis',
  64. 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
  65. 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
  66. ],
  67. 'dynamodb' => [
  68. 'driver' => 'dynamodb',
  69. 'key' => env('AWS_ACCESS_KEY_ID'),
  70. 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  71. 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
  72. 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
  73. 'endpoint' => env('DYNAMODB_ENDPOINT'),
  74. ],
  75. 'octane' => [
  76. 'driver' => 'octane',
  77. ],
  78. ],
  79. /*
  80. |--------------------------------------------------------------------------
  81. | Cache Key Prefix
  82. |--------------------------------------------------------------------------
  83. |
  84. | When utilizing the APC, database, memcached, Redis, and DynamoDB cache
  85. | stores, there might be other applications using the same cache. For
  86. | that reason, you may prefix every cache key to avoid collisions.
  87. |
  88. */
  89. 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
  90. ];