eustas/ngx_brotli

Append "Accept-Encoding" to an existing vary header, instead of always adding a new vary header.

ampaze opened this issue · 1 comments

The current mechanism of simply adding a vary header, can lead to something like this

vary: Accept-Encoding
vary: X-Requested-With

Which in turn, because of this bug https://trac.nginx.org/nginx/ticket/1423 leads to
proxy_cache_key not working correctly.

The gzip module has the same issue, but as a lot more browsers support gzip, it is not as often a visible problem.

Just to clarify what the result can look like:
image

As the Nginx ticket is not really worked on, maybe this can be fixed here, by appending Accept-Encoding to an existing vary header, if one exist?

vary: X-Requested-With, Accept-Encoding

Moved to the upstream