cache.php 3.6 KB

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