From 3ea9476aa8f97cbc713c08f0b0290766e37755e9 Mon Sep 17 00:00:00 2001 From: shibafu Date: Fri, 5 Jan 2018 00:54:33 +0900 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E7=95=AA=E6=99=82=E3=81=AF=E3=82=AD?= =?UTF-8?q?=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E3=81=97=E3=81=A6=E3=82=82?= =?UTF-8?q?=E3=81=84=E3=81=84=E3=82=93=E3=81=98=E3=82=83=E3=81=AA=E3=81=84?= =?UTF-8?q?=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/api.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/routes/api.php b/routes/api.php index 75a62bd..9e0aedb 100644 --- a/routes/api.php +++ b/routes/api.php @@ -59,7 +59,11 @@ Route::get('/ogp', function (Request $request) { } } - return response()->json($result); + $response = response()->json($result); + if (!config('app.debug')) { + $response = $response->setCache(['public' => true, 'max_age' => 86400]); + } + return $response; } else { abort($res->getStatusCode()); }