From b0e0210bc784f5e00e9d72c9e47dfdf155382837 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 8 Apr 2019 07:52:20 -0500 Subject: [PATCH] formatting --- responses.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/responses.md b/responses.md index 7bde9fbd7a8..38cbe6eaf35 100644 --- a/responses.md +++ b/responses.md @@ -65,20 +65,18 @@ Or, you may use the `withHeaders` method to specify an array of headers to be ad 'X-Header-Two' => 'Header Value', ]); -##### Cache Control middleware +##### Cache Control Middleware -Laravel ships with a convenient `cache.headers` middleware. It will attach your custom cache directives to the response `Cache-Control` header, as long it has been made through `GET` and `HEAD` requests and the content is not empty. +Laravel includes a `cache.headers` middleware, which may be used to quickly set the `Cache-Control` header for a group of routes: Route::middleware('cache-control:public,max-age=2628000;etag')->group(function() { - - Route::get('privacy-policy', function () { + Route::get('privacy', function () { // ... }); - - Route::get('terms-and-conditions', function () { + + Route::get('terms', function () { // ... }); - });