Skip to content

Commit cee4c78

Browse files
Merge #910
910: Add Vary header to prevent caching routes with different content types r=carols10cents 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. I was able to reproduce the problem with reloading locally when, instead of using `ember serve`, I ran `npm run build -- --environment production` and then served the files in `dist` using nginx. This change fixed the problem! @sgrif @jtgeibel do yinz see any reason NOT to set this header for literally any non-asset route?
2 parents 1b67e1f + 087924b commit cee4c78

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)