responsecache.php 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. return [
  3. /*
  4. * Determine if the response cache middleware should be enabled.
  5. */
  6. 'enabled' => env('RESPONSE_CACHE_ENABLED', false),
  7. /*
  8. * The given class will determinate if a request should be cached. The
  9. * default class will cache all successful GET-requests.
  10. *
  11. * You can provide your own class given that it implements the
  12. * CacheProfile interface.
  13. */
  14. 'cache_profile' => Spatie\ResponseCache\CacheProfiles\CacheAllSuccessfulGetRequests::class,
  15. /*
  16. * Optionally, you can specify a header that will force a cache bypass.
  17. * This can be useful to monitor the performance of your application.
  18. */
  19. 'cache_bypass_header' => [
  20. 'name' => env('CACHE_BYPASS_HEADER_NAME', null),
  21. 'value' => env('CACHE_BYPASS_HEADER_VALUE', null),
  22. ],
  23. /*
  24. * When using the default CacheRequestFilter this setting controls the
  25. * default number of seconds responses must be cached.
  26. */
  27. 'cache_lifetime_in_seconds' => env('RESPONSE_CACHE_LIFETIME', 60 * 60 * 24 * 7),
  28. /*
  29. * This setting determines if a http header named with the cache time
  30. * should be added to a cached response. This can be handy when
  31. * debugging.
  32. */
  33. 'add_cache_time_header' => env('APP_DEBUG', true),
  34. /*
  35. * This setting determines the name of the http header that contains
  36. * the time at which the response was cached
  37. */
  38. 'cache_time_header_name' => env('RESPONSE_CACHE_HEADER_NAME', 'Bagisto-FPC'),
  39. /*
  40. * This setting determines if a http header named with the cache age
  41. * should be added to a cached response. This can be handy when
  42. * debugging.
  43. * ONLY works when "add_cache_time_header" is also active!
  44. */
  45. 'add_cache_age_header' => env('RESPONSE_CACHE_AGE_HEADER', false),
  46. /*
  47. * This setting determines the name of the http header that contains
  48. * the age of cache
  49. */
  50. 'cache_age_header_name' => env('RESPONSE_CACHE_AGE_HEADER_NAME', 'Bagisto-FPC-Age'),
  51. /*
  52. * Here you may define the cache store that should be used to store
  53. * requests. This can be the name of any store that is
  54. * configured in app/config/cache.php
  55. */
  56. 'cache_store' => env('RESPONSE_CACHE_DRIVER', 'file'),
  57. /*
  58. * Here you may define replacers that dynamically replace content from the response.
  59. * Each replacer must implement the Replacer interface.
  60. */
  61. 'replacers' => [
  62. \Spatie\ResponseCache\Replacers\CsrfTokenReplacer::class,
  63. \Webkul\FPC\Replacers\FlashMessagesReplacer::class,
  64. ],
  65. /*
  66. * If the cache driver you configured supports tags, you may specify a tag name
  67. * here. All responses will be tagged. When clearing the responsecache only
  68. * items with that tag will be flushed.
  69. *
  70. * You may use a string or an array here.
  71. */
  72. 'cache_tag' => '',
  73. /*
  74. * This class is responsible for generating a hash for a request. This hash
  75. * is used to look up a cached response.
  76. */
  77. 'hasher' => \Webkul\FPC\Hasher\DefaultHasher::class,
  78. /*
  79. * This class is responsible for serializing responses.
  80. */
  81. 'serializer' => \Spatie\ResponseCache\Serializers\DefaultSerializer::class,
  82. ];