cache.php 3.1 KB

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