mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-25 06:23:18 +00:00
Update ProfileController, remove actor object caching
This commit is contained in:
parent
7680e771a7
commit
6e8e9a2d5e
1 changed files with 4 additions and 8 deletions
|
@ -171,15 +171,11 @@ class ProfileController extends Controller
|
||||||
{
|
{
|
||||||
abort_if(!config('federation.activitypub.enabled'), 404);
|
abort_if(!config('federation.activitypub.enabled'), 404);
|
||||||
abort_if($user->domain, 404);
|
abort_if($user->domain, 404);
|
||||||
$key = 'profile:ap:' . $user->id;
|
|
||||||
$ttl = now()->addMinutes(15);
|
|
||||||
|
|
||||||
return Cache::remember($key, $ttl, function() use($user) {
|
|
||||||
$fractal = new Fractal\Manager();
|
$fractal = new Fractal\Manager();
|
||||||
$resource = new Fractal\Resource\Item($user, new ProfileTransformer);
|
$resource = new Fractal\Resource\Item($user, new ProfileTransformer);
|
||||||
$res = $fractal->createData($resource)->toArray();
|
$res = $fractal->createData($resource)->toArray();
|
||||||
return response(json_encode($res['data']))->header('Content-Type', 'application/activity+json');
|
return response(json_encode($res['data']))->header('Content-Type', 'application/activity+json');
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showAtomFeed(Request $request, $user)
|
public function showAtomFeed(Request $request, $user)
|
||||||
|
|
Loading…
Reference in a new issue