diff --git a/etc/vcl_snippets/fetch.vcl b/etc/vcl_snippets/fetch.vcl index 49ef9e5f..0e697261 100644 --- a/etc/vcl_snippets/fetch.vcl +++ b/etc/vcl_snippets/fetch.vcl @@ -52,7 +52,9 @@ if (!beresp.http.Vary ~ "Accept-Encoding") { set beresp.http.Vary:Accept-Encoding = ""; } - if (req.http.Accept-Encoding == "gzip") { + if (req.http.Accept-Encoding == "br") { + set beresp.brotli = true; + } else if (req.http.Accept-Encoding == "gzip") { set beresp.gzip = true; } } diff --git a/etc/vcl_snippets/recv.vcl b/etc/vcl_snippets/recv.vcl index dad826df..56f3c38e 100644 --- a/etc/vcl_snippets/recv.vcl +++ b/etc/vcl_snippets/recv.vcl @@ -106,6 +106,13 @@ set req.http.Https = "on"; } + # Add support for Brotli static compression + if (req.http.Fastly-Orig-Accept-Encoding) { + if (req.http.Fastly-Orig-Accept-Encoding ~ "\bbr\b") { + set req.http.Accept-Encoding = "br"; + } + } + if (fastly.ff.visits_this_service > 0) { # disable ESI processing on Origin Shield set req.esi = false;