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

Only strip headers on edge nodes, not on shield nodes. #667

Merged
merged 1 commit into from
Sep 7, 2015
Merged
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
11 changes: 8 additions & 3 deletions vcl/main.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ sub vcl_deliver {
# If the backend has indicated additional Vary headers to add once the
# ESI result has been processed, then we'll go ahead and either append them
# to our existing Vary header or we'll set the Vary header equal to it.
if (resp.http.Warehouse-ESI-Vary) {
# However, we only want this logic to happen on the edge nodes, not on the
# shielding nodes.
if (resp.http.Warehouse-ESI-Vary && !req.http.Fastly-FF) {
if (resp.http.Vary) {
set resp.http.Vary = resp.http.Vary ", " resp.http.Warehouse-ESI-Vary;
} else {
Expand All @@ -184,8 +186,11 @@ sub vcl_deliver {
}

# We no longer need the header that enables ESI, so we'll remove it from
# the output.
unset resp.http.Warehouse-ESI-Enable;
# the output if we're not on a shielding node, otherwise we want to pass
# this header on to the edge nodes so that they can handle the ESI.
if (!req.http.Fastly-FF) {
unset resp.http.Warehouse-ESI-Enable;
}

# Unset headers that we don't need/want to send on to the client because
# they are not generally useful.
Expand Down