We've noticed that the manifests.txt cache on Fastly is sometimes outdated after a new nightly is published. This is purge by promote-release here (https://github.com/rust-lang/promote-release/blob/44a5f66b1e0b9d780a8737abcbe41587e952dbb0/src/fastly.rs#L19, https://github.com/rust-lang/promote-release/blob/44a5f66b1e0b9d780a8737abcbe41587e952dbb0/src/main.rs#L611). That code generally speaking works for CloudFront because CloudFront supports path-based invalidation. Fastly requires 'tags' to be set on URLs at request time, and then those are invalidated later: https://www.fastly.com/documentation/reference/api/purging/#purge-tag
We will need to extend
|
snippet { |
|
name = "set cache key for dist" |
|
type = "fetch" |
|
content = <<-VCL |
|
if (req.url ~ "^\/dist\/") { |
|
set beresp.http.Surrogate-Key = "dist"; |
|
} |
|
VCL |
|
} |
to add a tag (surrogate key) to the manifests.txt object and wire up purging for it. That tag should be
manifeststxt per
https://github.com/rust-lang/promote-release/blob/44a5f66b1e0b9d780a8737abcbe41587e952dbb0/src/fastly.rs#L48.
cc https://rust-lang.zulipchat.com/#narrow/channel/241545-t-release/topic/manifests.2Etxt.20CDN.20outdated/with/560117719
We've noticed that the manifests.txt cache on Fastly is sometimes outdated after a new nightly is published. This is purge by promote-release here (https://github.com/rust-lang/promote-release/blob/44a5f66b1e0b9d780a8737abcbe41587e952dbb0/src/fastly.rs#L19, https://github.com/rust-lang/promote-release/blob/44a5f66b1e0b9d780a8737abcbe41587e952dbb0/src/main.rs#L611). That code generally speaking works for CloudFront because CloudFront supports path-based invalidation. Fastly requires 'tags' to be set on URLs at request time, and then those are invalidated later: https://www.fastly.com/documentation/reference/api/purging/#purge-tag
We will need to extend
simpleinfra/terragrunt/modules/release-distribution/fastly-static.tf
Lines 82 to 90 in 5fe9fb7
manifeststxtper https://github.com/rust-lang/promote-release/blob/44a5f66b1e0b9d780a8737abcbe41587e952dbb0/src/fastly.rs#L48.cc https://rust-lang.zulipchat.com/#narrow/channel/241545-t-release/topic/manifests.2Etxt.20CDN.20outdated/with/560117719