cache.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. /*
  18. |--------------------------------------------------------------------------
  19. | Cache Stores
  20. |--------------------------------------------------------------------------
  21. |
  22. | Here you may define all of the cache "stores" for your application as
  23. | well as their drivers. You may even define multiple stores for the
  24. | same cache driver to group types of items stored in your caches.
  25. |
  26. */
  27. 'stores' => [
  28. 'apc' => [
  29. 'driver' => 'apc',
  30. ],
  31. 'array' => [
  32. 'driver' => 'array',
  33. ],
  34. 'database' => [
  35. 'driver' => 'database',
  36. 'table' => 'cache',
  37. 'connection' => null,
  38. ],
  39. 'file' => [
  40. 'driver' => 'file',
  41. 'path' => storage_path('framework/cache/data'),
  42. ],
  43. 'memcached' => [
  44. 'driver' => 'memcached',
  45. 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
  46. 'sasl' => [
  47. env('MEMCACHED_USERNAME'),
  48. env('MEMCACHED_PASSWORD'),
  49. ],
  50. 'options' => [
  51. // Memcached::OPT_CONNECT_TIMEOUT => 2000,
  52. ],
  53. 'servers' => [
  54. [
  55. 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
  56. 'port' => env('MEMCACHED_PORT', 11211),
  57. 'weight' => 100,
  58. ],
  59. ],
  60. ],
  61. 'redis' => [
  62. 'driver' => 'redis',
  63. 'connection' => 'cache',
  64. ],
  65. ],
  66. /*
  67. |--------------------------------------------------------------------------
  68. | Cache Key Prefix
  69. |--------------------------------------------------------------------------
  70. |
  71. | When utilizing a RAM based store such as APC or Memcached, there might
  72. | be other applications utilizing the same cache. So, we'll specify a
  73. | value to get prefixed to all our keys so we can avoid collisions.
  74. |
  75. */
  76. 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
  77. ];