about summary refs log tree commit diff
path: root/app/controllers/follower_accounts_controller.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-04-04 01:30:44 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-04-04 01:30:44 +0200
commitcc6e3c39001c11c82b198e357dd5d3e3fc032637 (patch)
treee075a73801a32115c0137a7bf4ae8f1f7daee1de /app/controllers/follower_accounts_controller.rb
parentd4882aa64a7a483ec30ca61a507c2a6f5d3294f5 (diff)
Cache featured collections, as well as outbox, followers and following (#10467)
Diffstat (limited to 'app/controllers/follower_accounts_controller.rb')
-rw-r--r--app/controllers/follower_accounts_controller.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/follower_accounts_controller.rb b/app/controllers/follower_accounts_controller.rb
index aea42bd63..713365ea5 100644
--- a/app/controllers/follower_accounts_controller.rb
+++ b/app/controllers/follower_accounts_controller.rb
@@ -3,6 +3,8 @@
 class FollowerAccountsController < ApplicationController
   include AccountControllerConcern
 
+  before_action :set_cache_headers
+
   def index
     respond_to do |format|
       format.html do
@@ -17,6 +19,11 @@ class FollowerAccountsController < ApplicationController
       format.json do
         raise Mastodon::NotPermittedError if params[:page].present? && @account.user_hides_network?
 
+        if params[:page].blank?
+          skip_session!
+          expires_in 3.minutes, public: true
+        end
+
         render json: collection_presenter,
                serializer: ActivityPub::CollectionSerializer,
                adapter: ActivityPub::Adapter,