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