Skip to content

v2.18.0 - Cache

Compare
Choose a tag to compare
@AndrewBarba AndrewBarba released this 28 Sep 23:49
· 10 commits to main since this release

This release adds support for Fastly's Cache API allowing you to cache and retrieve arbitrary data during a request:

let data = try await Cache.getOrSet("my-page") {
    let res = try await expensivePageRender()
    return (res, .ttl(60))
}

try await res
    .status(200)
    .header(.contentLength, "\(data.contentLength)")
    .send(data.body)