about summary refs log tree commit diff
path: root/app/controllers/activitypub/collections_controller.rb
diff options
context:
space:
mode:
authormultiple creatures <multiple_creatures@monsterware.dev>2020-01-17 10:36:42 +0000
committermultiple creatures <multiple_creatures@monsterware.dev>2020-01-17 10:36:42 +0000
commitd2acdf2ea68dce252e827041d226d4402369669b (patch)
treec4c8acbd7b1b745aadeb60547639f341fd7d7da8 /app/controllers/activitypub/collections_controller.rb
parent753d06495189dd6ffd95ea91028cc2a03866e974 (diff)
parent7b4381b4bdd2e3535b907abfe5f5ffa702d692aa (diff)
Merge pull request 'Port CacheConcern from upstream to define render_with_cache' (#13) from blueraccoon/port-cacheconcern into master
Reviewed-on: https://monsterware.dev/monsterpit/mastodon/pulls/13
Diffstat (limited to 'app/controllers/activitypub/collections_controller.rb')
-rw-r--r--app/controllers/activitypub/collections_controller.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/controllers/activitypub/collections_controller.rb b/app/controllers/activitypub/collections_controller.rb
index e2274ee1a..cd23506f3 100644
--- a/app/controllers/activitypub/collections_controller.rb
+++ b/app/controllers/activitypub/collections_controller.rb
@@ -9,14 +9,8 @@ class ActivityPub::CollectionsController < Api::BaseController
   before_action :set_cache_headers
 
   def show
-    render_cached_json(['activitypub', 'collection', @account, params[:id]], content_type: 'application/activity+json') do
-      ActiveModelSerializers::SerializableResource.new(
-        collection_presenter,
-        serializer: ActivityPub::CollectionSerializer,
-        adapter: ActivityPub::Adapter,
-        skip_activities: true
-      )
-    end
+    expires_in 3.minutes
+    render_with_cache json: collection_presenter, content_type: 'application/activity+json', serializer: ActivityPub::CollectionSerializer, adapter: ActivityPub::Adapter, skip_activities: true
   end
 
   private