本番時はキャッシュしてもいいんじゃない?

This commit is contained in:
shibafu 2018-01-05 00:54:33 +09:00
parent b562b3b400
commit 3ea9476aa8

View File

@ -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 { } else {
abort($res->getStatusCode()); abort($res->getStatusCode());
} }