Split header time from body-read time on the docs upstream - #1674
Merged
Conversation
fetch() resolves when headers arrive, so the earlier probe returned ~1ms without ever reading a body. Both genuinely slow operations read one: the docs proxy reads a 179KB page and the JWKS store calls hit.json(). Time headers and body separately on the exact upstream the docs proxy uses, gated to /robots.txt so normal traffic never pays for it.
Contributor
Cloudflare previewTorn down — the PR is closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Elimination so far, all measured in the same requests that took 3-11s wall:
preWorkMs0-4ms,cacheProbeMs2-21ms,timerProbeMs1ms,fetchProbeMsmedian 1ms, cpu 18-323ms.Everything generic is fast. But two app operations are genuinely slow, and both read a response body:
http.client GETtoexecutor.mintlify.dev— p50 3001ms from the Worker, while the same URL is 0.063-0.196s from a laptop (x-vercel-cache: HIT, 179KB) and a probe fetch to cloudflare.com from inside the same request is 1ms.workos.session.jwt_verify— p50 2895ms, whose only I/O is a Cache API hit plushit.json(), while a Cache API miss probe is 4ms.The earlier
fetchProbeMsnever read a body, which is why it looked fast. This times headers and body separately. Gated to/robots.txt.