Skip to content

Commit 087924b

Browse files
committed
Add Vary header to prevent caching routes with different content types
Such as the /me route, which can be requested by the browser for its frontend HTML or its backend JSON, but the browser should not cache either and return it for the other one. Fixes #888.
1 parent 482d461 commit 087924b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

config/nginx.conf.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ http {
4747

4848
location / {
4949
add_header Strict-Transport-Security "max-age=31536000" always;
50+
add_header Vary 'Accept, Accept-Encoding, Cookie';
5051
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
5152
proxy_set_header Host $http_host;
5253
proxy_redirect off;

0 commit comments

Comments
 (0)