v2.18.0 - Cache
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)