cache.php 3.0 KB

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