Update DiscoverController

This commit is contained in:
Daniel Supernault 2019-03-02 12:29:29 -07:00
parent 8bd3876e5b
commit 29fa8ffec5
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -37,7 +37,7 @@ class DiscoverController extends Controller
$page = $request->input('page') ?? 1; $page = $request->input('page') ?? 1;
$key = 'discover:tag-'.$tag->id.':page-'.$page; $key = 'discover:tag-'.$tag->id.':page-'.$page;
$keyMinutes = $page > 1 ? 5 : 2; $keyMinutes = $page == 1 ? 15 : 5;
$posts = Cache::remember($key, now()->addMinutes($keyMinutes), function() use ($tag, $request) { $posts = Cache::remember($key, now()->addMinutes($keyMinutes), function() use ($tag, $request) {
return $tag->posts() return $tag->posts()