From 3b7802814def584801fcce7e6bccd264370282b7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 24 Feb 2019 23:02:11 -0700 Subject: [PATCH] Update PublicApiController --- app/Http/Controllers/PublicApiController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index 510b1571..c3a734f1 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -305,8 +305,10 @@ class PublicApiController extends Controller // $timeline = Timeline::build()->local(); $pid = Auth::user()->profile->id; - $following = Follower::whereProfileId($pid)->pluck('following_id'); - $following->push($pid)->toArray(); + $following = Cache::remember('profile:following:'.$pid, 1440, function() use($pid) { + $following = Follower::whereProfileId($pid)->pluck('following_id'); + return $following->push($pid)->toArray(); + }); $private = Profile::whereIsPrivate(true)->orWhereNotNull('status')->where('id', '!=', $pid)->pluck('id'); $filters = UserFilter::whereUserId($pid)