diff --git a/spec/test-outputs/www-eks-integration.out.vcl b/spec/test-outputs/www-eks-integration.out.vcl index d1cf1e8e..5aeca122 100644 --- a/spec/test-outputs/www-eks-integration.out.vcl +++ b/spec/test-outputs/www-eks-integration.out.vcl @@ -58,6 +58,13 @@ sub vcl_recv { + # Strip Accept-Encoding header if the content is already compressed + if (req.http.Accept-Encoding) { + if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") { + remove req.http.Accept-Encoding; + } + } + # Force SSL. if (!req.http.Fastly-SSL) { error 801 "Force SSL"; diff --git a/spec/test-outputs/www-eks-production.out.vcl b/spec/test-outputs/www-eks-production.out.vcl index a0a1e1d6..14fb1523 100644 --- a/spec/test-outputs/www-eks-production.out.vcl +++ b/spec/test-outputs/www-eks-production.out.vcl @@ -151,6 +151,13 @@ sub vcl_recv { + # Strip Accept-Encoding header if the content is already compressed + if (req.http.Accept-Encoding) { + if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") { + remove req.http.Accept-Encoding; + } + } + # Force SSL. if (!req.http.Fastly-SSL) { error 801 "Force SSL"; diff --git a/spec/test-outputs/www-eks-staging.out.vcl b/spec/test-outputs/www-eks-staging.out.vcl index 63333b9a..c313e5f5 100644 --- a/spec/test-outputs/www-eks-staging.out.vcl +++ b/spec/test-outputs/www-eks-staging.out.vcl @@ -159,6 +159,13 @@ sub vcl_recv { + # Strip Accept-Encoding header if the content is already compressed + if (req.http.Accept-Encoding) { + if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") { + remove req.http.Accept-Encoding; + } + } + # Force SSL. if (!req.http.Fastly-SSL) { error 801 "Force SSL"; diff --git a/spec/test-outputs/www-eks-test.out.vcl b/spec/test-outputs/www-eks-test.out.vcl index c6d9bd0c..26b5311b 100644 --- a/spec/test-outputs/www-eks-test.out.vcl +++ b/spec/test-outputs/www-eks-test.out.vcl @@ -55,6 +55,13 @@ sub vcl_recv { + # Strip Accept-Encoding header if the content is already compressed + if (req.http.Accept-Encoding) { + if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") { + remove req.http.Accept-Encoding; + } + } + # Force SSL. if (!req.http.Fastly-SSL) { error 801 "Force SSL"; diff --git a/spec/test-outputs/www-integration.out.vcl b/spec/test-outputs/www-integration.out.vcl index d1cf1e8e..5aeca122 100644 --- a/spec/test-outputs/www-integration.out.vcl +++ b/spec/test-outputs/www-integration.out.vcl @@ -58,6 +58,13 @@ sub vcl_recv { + # Strip Accept-Encoding header if the content is already compressed + if (req.http.Accept-Encoding) { + if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") { + remove req.http.Accept-Encoding; + } + } + # Force SSL. if (!req.http.Fastly-SSL) { error 801 "Force SSL"; diff --git a/spec/test-outputs/www-production.out.vcl b/spec/test-outputs/www-production.out.vcl index a0a1e1d6..14fb1523 100644 --- a/spec/test-outputs/www-production.out.vcl +++ b/spec/test-outputs/www-production.out.vcl @@ -151,6 +151,13 @@ sub vcl_recv { + # Strip Accept-Encoding header if the content is already compressed + if (req.http.Accept-Encoding) { + if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") { + remove req.http.Accept-Encoding; + } + } + # Force SSL. if (!req.http.Fastly-SSL) { error 801 "Force SSL"; diff --git a/spec/test-outputs/www-staging.out.vcl b/spec/test-outputs/www-staging.out.vcl index 63333b9a..c313e5f5 100644 --- a/spec/test-outputs/www-staging.out.vcl +++ b/spec/test-outputs/www-staging.out.vcl @@ -159,6 +159,13 @@ sub vcl_recv { + # Strip Accept-Encoding header if the content is already compressed + if (req.http.Accept-Encoding) { + if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") { + remove req.http.Accept-Encoding; + } + } + # Force SSL. if (!req.http.Fastly-SSL) { error 801 "Force SSL"; diff --git a/spec/test-outputs/www-test.out.vcl b/spec/test-outputs/www-test.out.vcl index c6d9bd0c..26b5311b 100644 --- a/spec/test-outputs/www-test.out.vcl +++ b/spec/test-outputs/www-test.out.vcl @@ -55,6 +55,13 @@ sub vcl_recv { + # Strip Accept-Encoding header if the content is already compressed + if (req.http.Accept-Encoding) { + if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") { + remove req.http.Accept-Encoding; + } + } + # Force SSL. if (!req.http.Fastly-SSL) { error 801 "Force SSL"; diff --git a/vcl_templates/www.vcl.erb b/vcl_templates/www.vcl.erb index 6bcbe2fc..cb6ef709 100644 --- a/vcl_templates/www.vcl.erb +++ b/vcl_templates/www.vcl.erb @@ -202,6 +202,13 @@ sub vcl_recv { } <% end %> + # Strip Accept-Encoding header if the content is already compressed + if (req.http.Accept-Encoding) { + if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") { + remove req.http.Accept-Encoding; + } + } + # Force SSL. if (!req.http.Fastly-SSL) { error 801 "Force SSL";