diff options
Diffstat (limited to 'app/controllers/emojis_controller.rb')
-rw-r--r-- | app/controllers/emojis_controller.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/emojis_controller.rb b/app/controllers/emojis_controller.rb index a82b9340b..c9725ccc0 100644 --- a/app/controllers/emojis_controller.rb +++ b/app/controllers/emojis_controller.rb @@ -2,14 +2,16 @@ class EmojisController < ApplicationController before_action :set_emoji + before_action :set_cache_headers def show respond_to do |format| format.json do - render json: @emoji, - serializer: ActivityPub::EmojiSerializer, - adapter: ActivityPub::Adapter, - content_type: 'application/activity+json' + skip_session! + + render_cached_json(['activitypub', 'emoji', @emoji.cache_key], content_type: 'application/activity+json') do + ActiveModelSerializers::SerializableResource.new(@emoji, serializer: ActivityPub::EmojiSerializer, adapter: ActivityPub::Adapter) + end end end end |