Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Brotli static compression #688

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion etc/vcl_snippets/fetch.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
7 changes: 7 additions & 0 deletions etc/vcl_snippets/recv.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading