cache.php 3.8 KB

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