Skip to content

Setup Fastly surrogate key for purging manifests.txt #828

@Mark-Simulacrum

Description

@Mark-Simulacrum

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions