From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 847B91F487 for ; Sat, 4 Apr 2020 23:50:47 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] extras/try_gzip_static: set "Vary: Accept-Encoding" on gzip Date: Sat, 4 Apr 2020 23:50:47 +0000 Message-Id: <20200404235047.16621-1-bofh@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Some rare clients may not support gzip. So ensure cache layers don't inadvertantly serve cached content to them. --- extras/try_gzip_static.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extras/try_gzip_static.rb b/extras/try_gzip_static.rb index 4dd435a..a2dd155 100644 --- a/extras/try_gzip_static.rb +++ b/extras/try_gzip_static.rb @@ -79,7 +79,10 @@ def fheader(env, path, st, gz_st = nil, len = nil) "Accept-Ranges" => "bytes", } h["Cache-Control"] = "no-transform" unless mime =~ %r{\Atext\/} - h["Content-Encoding"] = "gzip" if gz_st + if gz_st + h["Content-Encoding"] = "gzip" + h["Vary"] = "Accept-Encoding" + end h end