cache.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. ],
  33. 'database' => [
  34. 'driver' => 'database',
  35. 'table' => 'cache',
  36. 'connection' => null,
  37. ],
  38. 'file' => [
  39. 'driver' => 'file',
  40. 'path' => storage_path('framework/cache/data'),
  41. ],
  42. 'memcached' => [
  43. 'driver' => 'memcached',
  44. 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
  45. 'sasl' => [
  46. env('MEMCACHED_USERNAME'),
  47. env('MEMCACHED_PASSWORD'),
  48. ],
  49. 'options' => [
  50. // Memcached::OPT_CONNECT_TIMEOUT => 2000,
  51. ],
  52. 'servers' => [
  53. [
  54. 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
  55. 'port' => env('MEMCACHED_PORT', 11211),
  56. 'weight' => 100,
  57. ],
  58. ],
  59. ],
  60. 'redis' => [
  61. 'driver' => 'redis',
  62. 'client' => env('REDIS_CLIENT', 'phpredis'),
  63. 'default' => [
  64. 'scheme' => env('REDIS_SCHEME', 'tcp'),
  65. 'path' => env('REDIS_PATH'),
  66. 'host' => env('REDIS_HOST', 'localhost'),
  67. 'password' => env('REDIS_PASSWORD', null),
  68. 'port' => env('REDIS_PORT', 6379),
  69. 'database' => env('REDIS_DATABASE', 0),
  70. ],
  71. ],
  72. ],
  73. /*
  74. |--------------------------------------------------------------------------
  75. | Cache Key Prefix
  76. |--------------------------------------------------------------------------
  77. |
  78. | When utilizing a RAM based store such as APC or Memcached, there might
  79. | be other applications utilizing the same cache. So, we'll specify a
  80. | value to get prefixed to all our keys so we can avoid collisions.
  81. |
  82. */
  83. 'prefix' => env(
  84. 'CACHE_PREFIX',
  85. str_slug(env('APP_NAME', 'laravel'), '_').'_cache'
  86. ),
  87. ];