cache.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. use Illuminate\Support\Str;
  3. return [
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Default Cache Store
  7. |--------------------------------------------------------------------------
  8. |
  9. | This option controls the default cache connection that gets used while
  10. | using this caching library. This connection is used when another is
  11. | not explicitly specified when executing a given caching function.
  12. |
  13. | Supported: "apc", "array", "database", "file", "memcached", "redis"
  14. |
  15. */
  16. // 'default' => env('CACHE_DRIVER', 'file'),
  17. 'default' => env('CACHE_DRIVER', 'memcached'),
  18. /*
  19. |--------------------------------------------------------------------------
  20. | Cache Stores
  21. |--------------------------------------------------------------------------
  22. |
  23. | Here you may define all of the cache "stores" for your application as
  24. | well as their drivers. You may even define multiple stores for the
  25. | same cache driver to group types of items stored in your caches.
  26. |
  27. */
  28. 'stores' => [
  29. 'apc' => [
  30. 'driver' => 'apc',
  31. ],
  32. 'array' => [
  33. 'driver' => 'array',
  34. ],
  35. 'database' => [
  36. 'driver' => 'database',
  37. 'table' => env('CACHE_DATABASE_TABLE', 'cache'),
  38. 'connection' => env('CACHE_DATABASE_CONNECTION', null),
  39. ],
  40. 'file' => [
  41. 'driver' => 'file',
  42. '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('CACHE_REDIS_CONNECTION', 'default'),
  65. ],
  66. ],
  67. /*
  68. |--------------------------------------------------------------------------
  69. | Cache Key Prefix
  70. |--------------------------------------------------------------------------
  71. |
  72. | When utilizing a RAM based store such as APC or Memcached, there might
  73. | be other applications utilizing the same cache. So, we'll specify a
  74. | value to get prefixed to all our keys so we can avoid collisions.
  75. |
  76. */
  77. 'prefix' => env(
  78. 'CACHE_PREFIX',
  79. Str::slug(env('APP_NAME', 'Laravel'), '_').'_cache'
  80. ),
  81. ];