about summary refs log tree commit diff
path: root/app/controllers/following_accounts_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/following_accounts_controller.rb')
-rw-r--r--app/controllers/following_accounts_controller.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/following_accounts_controller.rb b/app/controllers/following_accounts_controller.rb
index 03c4b1046..1bfd901cf 100644
--- a/app/controllers/following_accounts_controller.rb
+++ b/app/controllers/following_accounts_controller.rb
@@ -3,9 +3,13 @@
 class FollowingAccountsController < ApplicationController
   include AccountControllerConcern
 
+  before_action :set_cache_headers
+
   def index
     respond_to do |format|
       format.html do
+        mark_cacheable! unless user_signed_in?
+
         next if @account.user_hides_network?
 
         follows
@@ -15,6 +19,11 @@ class FollowingAccountsController < 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,