Skip to content

Commit 4bae2f7

Browse files
committed
Revert "Don't cache responses"
This reverts commit 5205c05.
1 parent 5205c05 commit 4bae2f7

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

app/controllers/application_controller.rb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ def fetch_locale
3939
end
4040

4141
def set_cache_headers
42-
headers['Cache-Control'] = 'no-store, no-cache, max-age=0, private, must-revalidate'
43-
headers['Pragma'] = 'no-cache'
44-
headers['Expires'] = '0'
45-
46-
# Keep HSTS header
47-
headers['Strict-Transport-Security'] = 'max-age=31536000; includeSubDomains; preload'
42+
if action_name != 'random'
43+
expires_in 7.day, public: true
44+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
45+
headers['Strict-Transport-Security'] = 'max-age=31536000; includeSubDomains; preload'
46+
end
4847

49-
# Keep CORS header
5048
headers['Access-Control-Allow-Origin'] = '*'
5149
end
5250

0 commit comments

Comments
 (0)