From c3d1594576227fcbc45d1da97f474acbd23d831b Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Sun, 17 Mar 2019 09:39:25 -0500 Subject: Reduce server load caused by anonymous viewing. (#9059) Do not start a session if the current user is not logged in for public-facing pages. Mark pages that don't care about sessions as publicly cacheable. Keep the max age as 0 so proxies and browsers will still try to retrieve an updated version but can still fall back to the stale version if the site is down or too slow. Fixes #9035. --- app/controllers/follower_accounts_controller.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/controllers/follower_accounts_controller.rb') diff --git a/app/controllers/follower_accounts_controller.rb b/app/controllers/follower_accounts_controller.rb index 99cb3676f..aea42bd63 100644 --- a/app/controllers/follower_accounts_controller.rb +++ b/app/controllers/follower_accounts_controller.rb @@ -6,6 +6,8 @@ class FollowerAccountsController < ApplicationController def index respond_to do |format| format.html do + mark_cacheable! unless user_signed_in? + next if @account.user_hides_network? follows -- cgit