diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-11-19 16:28:21 -0600 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-11-19 16:28:21 -0600 |
commit | 7f5ba917563aa1c9a373d9dd3a6a29f73d81ee9a (patch) | |
tree | de9fab15f73f3a6b5f691555c8dee5c62e702726 /app | |
parent | 3ee4deea65835546e0cc716f305e84a5994ba44c (diff) |
Cache requests to status objects by requesting account
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/statuses_controller.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/statuses_controller.rb b/app/controllers/statuses_controller.rb index a3ba43d7b..ad065a6fa 100644 --- a/app/controllers/statuses_controller.rb +++ b/app/controllers/statuses_controller.rb @@ -39,7 +39,12 @@ class StatusesController < ApplicationController format.json do expires_in 3.minutes, public: @status.distributable? && public_fetch_mode? - render_with_cache json: @status, content_type: 'application/activity+json', serializer: ActivityPub::NoteSerializer, adapter: ActivityPub::Adapter, domain: current_account&.domain + render_with_cache json: @status, + content_type: 'application/activity+json', + serializer: ActivityPub::NoteSerializer, + adapter: ActivityPub::Adapter, + domain: current_account&.domain, + key: "statuses/json:#{current_account&.id}:#{@status.id}" end end end @@ -50,7 +55,8 @@ class StatusesController < ApplicationController content_type: 'application/activity+json', serializer: ActivityPub::ActivitySerializer, adapter: ActivityPub::Adapter, - domain: current_account&.domain + domain: current_account&.domain, + key: "statuses/activity:#{current_account&.id}:#{@status.id}" end def embed |