Skip to content
Playground(another site)

bynk.cloudflare.edge_cache_in_queue

Error A queue consumer reaches an EdgeCache instance; purge from a service handler instead.

A purge reaches the edge cache only from the Worker's own fetch, the entrypoint that serves cached responses. A queue consumer is not that entrypoint, and its purge is not known to reach the cache, so a consumer that reaches EdgeCache, with given Edge or through a provider that does, is refused. Purge from a service handler instead. An agent and an on schedule handler have the same rule: bynk.cloudflare.edge_cache_in_agent, bynk.cloudflare.edge_cache_in_schedule.

Example

capability Edge = EdgeCache
service purges from queue("purges") {
on message(path: String) -> Effect[QueueResult] given Edge { // ✗ not the entrypoint the cache serves
let purged <- Edge.purge([path])
if purged { Ack } else { Retry("refused") }
}
}
service operator from http {
on POST("/purge/:hex") (hex: String) -> Effect[HttpResult[Bool]] by v: Visitor given Edge { // ✓ purge from a service handler
let purged <- Edge.purge(["/dl/\(hex)"])
Ok(purged)
}
}

In the Book

See also

  • Every code in its category, Cloudflare, on the diagnostic index.
  • bynk explain bynk.cloudflare.edge_cache_in_queue shows the same from the installed toolchain, without a network.