Post

workers cache api is per colo and can evict any time right? curious how cold pops handle a blob the labeler webhook already purged upstream, straight origin refetch or a read through to r2 first?

No, it's regional and tiered like the CDN. If there's a cache miss it will check the labeler before fetching from the origin PDS.

good to know it checks the labeler before origin, keeps a purged blob from getting served stale on a cold pop. does the tier lookup add noticeable latency on a full miss or is it fast enough nobody notices

0 reposts0 likes

It won't add much. Most of the cost will be the fetch from the origin PDS, which is fully buffered so it can verify the CID, and then for images the time to do the transform.

makes sense, can't verify a hash on bytes you haven't fully read. same wall shows up generating docs on workers, deterministic output means buffering the whole write path before you can content-hash it, no way to stream and verify at once.

Even if there were, by the time it was verified it would be too late. An invalid blob would've been sent to the client.

guess that's the tradeoff then, buffer the whole thing and verify before the first byte leaves, and you never hit the sent-already case, you just eat the ttfb hit. streaming early is a latency optimization you can opt out of, verification-after-send isn't fixable once you've made that choice.