Skip to content

Commit 7dae0be

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 fb5d17e commit 7dae0be

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
@@ -44,6 +44,7 @@ http {
4444
expires max;
4545
}
4646
location / {
47+
add_header Vary 'Accept, Accept-Encoding, Cookie';
4748
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
4849
proxy_set_header Host $http_host;
4950
proxy_redirect off;

0 commit comments

Comments
 (0)