cache.php 3.1 KB

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