Skip to content

Commit 25a07ab

Browse files
authored
Merge pull request #416 from jdno/rustup-surrogate-key
Tag rustup artifacts with surrogate key
2 parents 8465b62 + 384dcc9 commit 25a07ab

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

terragrunt/modules/release-distribution/fastly-static.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@ resource "fastly_service_vcl" "static" {
7979
VCL
8080
}
8181

82+
# When a new version of rustup is released, the release script invalidates
83+
# the CloudFront cache for `/rustup/*` and any object that is tagged with
84+
# the `rustup` key on Fastly.
85+
# See https://github.com/rust-lang/rustup/blob/master/ci/sync-dist.py for
86+
# details.
87+
snippet {
88+
name = "set cache key for rustup"
89+
type = "fetch"
90+
content = <<-VCL
91+
if (req.url ~ "^\/rustup\/") {
92+
set beresp.http.Surrogate-Key = "rustup";
93+
}
94+
VCL
95+
}
96+
8297
snippet {
8398
name = "redirect rustup.sh to rustup.rs"
8499
type = "error"

0 commit comments

Comments
 (0)