Skip to content

Commit 084f0b8

Browse files
ClearlyClaireGargron
authored andcommitted
Add some caching for HTML versions of statuses pages (mastodon#10701)
1 parent 74dd6ca commit 084f0b8

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

app/controllers/statuses_controller.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ class StatusesController < ApplicationController
2727
def show
2828
respond_to do |format|
2929
format.html do
30-
mark_cacheable! unless user_signed_in?
30+
unless user_signed_in?
31+
skip_session!
32+
expires_in 10.seconds, public: true
33+
end
3134

3235
@body_classes = 'with-modals'
3336

app/controllers/stream_entries_controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ class StreamEntriesController < ApplicationController
1515
def show
1616
respond_to do |format|
1717
format.html do
18+
unless user_signed_in?
19+
skip_session!
20+
expires_in 5.minutes, public: true
21+
end
22+
1823
redirect_to short_account_status_url(params[:account_username], @stream_entry.activity) if @type == 'status'
1924
end
2025

0 commit comments

Comments
 (0)