|
6 | 6 | */ |
7 | 7 | 'enabled' => env('RESPONSE_CACHE_ENABLED', true), |
8 | 8 |
|
9 | | - /* |
10 | | - * Cache configuration settings |
11 | | - */ |
12 | 9 | 'cache' => [ |
13 | 10 | /* |
14 | | - * Here you may define the cache store that should be used to store |
15 | | - * requests. This can be the name of any store that is |
16 | | - * configured in app/config/cache.php |
| 11 | + * Here you may define the cache store that should be used |
| 12 | + * to store requests. This can be the name of any store |
| 13 | + * that is configured in your app's cache.php config |
17 | 14 | */ |
18 | 15 | 'store' => env('RESPONSE_CACHE_DRIVER', 'file'), |
19 | 16 |
|
20 | 17 | /* |
21 | | - * When using the default CacheRequestFilter this setting controls the |
22 | | - * default number of seconds responses must be cached. |
| 18 | + * The default number of seconds responses will be cached |
| 19 | + * when using the default CacheProfile settings. |
23 | 20 | */ |
24 | 21 | 'lifetime_in_seconds' => (int) env('RESPONSE_CACHE_LIFETIME', 60 * 60 * 24 * 7), |
25 | 22 |
|
26 | 23 | /* |
27 | | - * If the cache driver you configured supports tags, you may specify a tag name |
28 | | - * here. All responses will be tagged. When clearing the responsecache only |
29 | | - * items with that tag will be flushed. |
| 24 | + * If your cache driver supports tags, you may specify a tag |
| 25 | + * name here. All responses will be tagged. When clearing |
| 26 | + * the responsecache only items with that tag flushed. |
30 | 27 | * |
31 | 28 | * You may use a string or an array here. |
32 | 29 | */ |
33 | 30 | 'tag' => env('RESPONSE_CACHE_TAG', ''), |
34 | 31 | ], |
35 | 32 |
|
36 | | - /* |
37 | | - * Cache bypass header configuration |
38 | | - */ |
39 | 33 | 'bypass' => [ |
40 | 34 | /* |
41 | | - * Whether cache bypass functionality is enabled |
42 | | - */ |
43 | | - 'enabled' => env('CACHE_BYPASS_HEADER_NAME') !== null, |
44 | | - |
45 | | - /* |
46 | | - * The header name that will force a cache bypass. |
47 | | - * This can be useful to monitor the performance of your application. |
| 35 | + * The header name that will force a bypass of the cache. |
| 36 | + * This is useful when you want to see the performance |
| 37 | + * of your application without the caching enabled. |
48 | 38 | */ |
49 | 39 | 'header_name' => env('CACHE_BYPASS_HEADER_NAME'), |
50 | 40 |
|
|
54 | 44 | 'header_value' => env('CACHE_BYPASS_HEADER_VALUE'), |
55 | 45 | ], |
56 | 46 |
|
57 | | - /* |
58 | | - * Debug and development settings |
59 | | - */ |
60 | 47 | 'debug' => [ |
61 | 48 | /* |
62 | | - * This setting determines if a http header named with the cache time |
63 | | - * should be added to a cached response. This can be handy when |
64 | | - * debugging. |
| 49 | + * Determines if debug headers are added to cached |
| 50 | + * responses. This can be handy for debugging how |
| 51 | + * response caching is performing in your app. |
| 52 | + */ |
| 53 | + 'enabled' => env('APP_DEBUG', false), |
| 54 | + |
| 55 | + /* |
| 56 | + * The name of the http header containing the |
| 57 | + * point at which the response was cached. |
65 | 58 | */ |
66 | | - 'add_time_header' => env('APP_DEBUG', false), |
| 59 | + 'cache_time_header_name' => 'X-Cache-Time', |
67 | 60 |
|
68 | 61 | /* |
69 | | - * This setting determines the name of the http header that contains |
70 | | - * the time at which the response was cached |
| 62 | + * The name of the header for the cache status that |
| 63 | + * indicates whether a response was HIT or MISS. |
71 | 64 | */ |
72 | | - 'time_header_name' => env('RESPONSE_CACHE_HEADER_NAME', 'laravel-responsecache'), |
| 65 | + 'cache_status_header_name' => 'X-Cache-Status', |
73 | 66 |
|
74 | 67 | /* |
75 | | - * This setting determines if a http header named with the cache age |
76 | | - * should be added to a cached response. This can be handy when |
77 | | - * debugging. |
78 | | - * ONLY works when "add_time_header" is also active! |
| 68 | + * The header name for the cache age in seconds. |
79 | 69 | */ |
80 | | - 'add_age_header' => env('RESPONSE_CACHE_AGE_HEADER', false), |
| 70 | + 'cache_age_header_name' => 'X-Cache-Age', |
81 | 71 |
|
82 | 72 | /* |
83 | | - * This setting determines the name of the http header that contains |
84 | | - * the age of cache |
| 73 | + * The header name used for the response cache key. |
| 74 | + * This is only added when app.debug is enabled. |
85 | 75 | */ |
86 | | - 'age_header_name' => env('RESPONSE_CACHE_AGE_HEADER_NAME', 'laravel-responsecache-age'), |
| 76 | + 'cache_key_header_name' => 'X-Cache-Key', |
87 | 77 | ], |
88 | 78 |
|
89 | 79 | /* |
90 | | - * Query parameters listed here will be ignored when generating the cache key. |
91 | | - * This is useful for tracking parameters like UTM tags or gclid that don't |
92 | | - * affect the page content but would otherwise create separate cache entries. |
| 80 | + * These query parameters will be ignored when generating |
| 81 | + * the cache key. This is useful for ignoring tracking |
| 82 | + * parameters like UTM tags, gclid and also fbclid. |
93 | 83 | */ |
94 | 84 | 'ignored_query_parameters' => [ |
95 | 85 | 'utm_source', |
|
102 | 92 | ], |
103 | 93 |
|
104 | 94 | /* |
105 | | - * Customization - Class implementations |
106 | | - */ |
107 | | - |
108 | | - /* |
109 | | - * The given class will determinate if a request should be cached. The |
110 | | - * default class will cache all successful GET-requests. |
111 | | - * |
112 | | - * You can provide your own class given that it implements the |
113 | | - * CacheProfile interface. |
| 95 | + * The given class determines if a request should be cached. |
| 96 | + * By default all successful GET-requests will be cached. |
| 97 | + * You can provide your own by using the CacheProfile. |
114 | 98 | */ |
115 | 99 | 'cache_profile' => Spatie\ResponseCache\CacheProfiles\CacheAllSuccessfulGetRequests::class, |
116 | 100 |
|
117 | 101 | /* |
118 | | - * This class is responsible for generating a hash for a request. This hash |
119 | | - * is used to look up a cached response. |
| 102 | + * This class is responsible for generating a hash for |
| 103 | + * a request. Used for looking up cached responses. |
120 | 104 | */ |
121 | 105 | 'hasher' => \Spatie\ResponseCache\Hasher\DefaultHasher::class, |
122 | 106 |
|
|
126 | 110 | 'serializer' => \Spatie\ResponseCache\Serializers\JsonSerializer::class, |
127 | 111 |
|
128 | 112 | /* |
129 | | - * Here you may define replacers that dynamically replace content from the response. |
130 | | - * Each replacer must implement the Replacer interface. |
| 113 | + * Here you may define the replacers that will replace |
| 114 | + * dynamic content from the response. Each replacer |
| 115 | + * must always implement the Replacer interface. |
131 | 116 | */ |
132 | 117 | 'replacers' => [ |
133 | 118 | \Spatie\ResponseCache\Replacers\CsrfTokenReplacer::class, |
|
0 commit comments