Moved location of adding Vary header as per comments from jonathanong on the pull request. HEAD requests and requests without the Accept-Encoding header will still have Vary set correctly.