Skip to content

Commit 1cfc5ef

Browse files
committed
Add configs
1 parent f15d8ce commit 1cfc5ef

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

app/controllers/application_controller.rb

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

4141
def set_cache_headers
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
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'
4748

49+
# Keep CORS header
4850
headers['Access-Control-Allow-Origin'] = '*'
4951
end
5052

0 commit comments

Comments
 (0)