Change logged-out WebUI HTML pages to be cached for a few seconds (#24708)

shrike
Claire 2023-04-28 10:27:26 +02:00 committed by GitHub
parent 8979b70975
commit faa336e3f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 7 deletions

View File

@ -8,7 +8,7 @@ class AboutController < ApplicationController
before_action :set_instance_presenter before_action :set_instance_presenter
def show def show
expires_in 0, public: true unless user_signed_in? expires_in(15.seconds, public: true, stale_while_revalidate: 30.seconds, stale_if_error: 1.day) unless user_signed_in?
end end
private private

View File

@ -17,7 +17,7 @@ class AccountsController < ApplicationController
def show def show
respond_to do |format| respond_to do |format|
format.html do format.html do
expires_in 0, public: true unless user_signed_in? expires_in(15.seconds, public: true, stale_while_revalidate: 30.seconds, stale_if_error: 1.hour) unless user_signed_in?
@rss_url = rss_url @rss_url = rss_url
end end

View File

@ -15,7 +15,7 @@ class FollowerAccountsController < ApplicationController
def index def index
respond_to do |format| respond_to do |format|
format.html do format.html do
expires_in 0, public: true unless user_signed_in? expires_in(15.seconds, public: true, stale_while_revalidate: 30.seconds, stale_if_error: 1.hour) unless user_signed_in?
end end
format.json do format.json do

View File

@ -15,7 +15,7 @@ class FollowingAccountsController < ApplicationController
def index def index
respond_to do |format| respond_to do |format|
format.html do format.html do
expires_in 0, public: true unless user_signed_in? expires_in(15.seconds, public: true, stale_while_revalidate: 30.seconds, stale_if_error: 1.hour) unless user_signed_in?
end end
format.json do format.json do

View File

@ -6,7 +6,7 @@ class HomeController < ApplicationController
before_action :set_instance_presenter before_action :set_instance_presenter
def index def index
expires_in 0, public: true unless user_signed_in? expires_in(15.seconds, public: true, stale_while_revalidate: 30.seconds, stale_if_error: 1.day) unless user_signed_in?
end end
private private

View File

@ -8,7 +8,7 @@ class PrivacyController < ApplicationController
before_action :set_instance_presenter before_action :set_instance_presenter
def show def show
expires_in 0, public: true if current_account.nil? expires_in(15.seconds, public: true, stale_while_revalidate: 30.seconds, stale_if_error: 1.day) unless user_signed_in?
end end
private private

View File

@ -21,7 +21,7 @@ class TagsController < ApplicationController
def show def show
respond_to do |format| respond_to do |format|
format.html do format.html do
expires_in 0, public: true unless user_signed_in? expires_in(15.seconds, public: true, stale_while_revalidate: 30.seconds, stale_if_error: 1.hour) unless user_signed_in?
end end
format.rss do format.rss do