We don't want to confuse intermediate caches into serving
gzipped content to any clients which can't handle it. It
probably doesn't matter in practice, though, since every HTTP
client seems to handle "Content-Encoding: gzip" regardless of
whether it was requested or not, though I could expect some
nc/socat/telnet/s_client users being annoyed.
This also matches the behavior of Plack::Middleware::Deflater
and other deflater implementations.
return unless -f $gz && (stat(_))[9] == $mtime;
my $res = response($env, $h, $gz, $type);
return if ($res->[0] > 300 || $res->[0] < 200);
- push @{$res->[1]}, qw(Cache-Control no-transform Content-Encoding gzip);
+ push @{$res->[1]}, qw(Cache-Control no-transform
+ Content-Encoding gzip
+ Vary Accept-Encoding);
$res;
}