Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Commit

Permalink
Vary on X-Request-Type to prevent Dynamic 404s to be counted against …
Browse files Browse the repository at this point in the history
…Static refetches, fixes #45 (potentially badly)
  • Loading branch information
trieloff committed Mar 15, 2019
1 parent 7f68958 commit 308f424
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions layouts/fastly/helix.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,12 @@ sub vcl_fetch {
set beresp.http.Vary = beresp.http.Vary + ",X-Strain";
}

# Vary on Request-Type, so that static requests don't interfere with
# dynamic requests: https://github.com/adobe/helix-publish/issues/45
if (beresp.http.Vary !~ "X-Request-Type") {
set beresp.http.Vary = beresp.http.Vary + ",X-Request-Type";
}

# TODO: Add Surrogate-Keys, based on req.url/X-Orig-URL

if (beresp.http.Expires || beresp.http.Surrogate-Control ~ "max-age" || beresp.http.Cache-Control ~ "(s-maxage|max-age)") {
Expand Down

0 comments on commit 308f424

Please sign in to comment.