Unify how a response's shell and full payloads are written (#96878)
A response may contain two payloads: the full response, plus a shell stage that the client obtains by decoding the same bytes again, truncated at the shell byte offset. Each flow had its own copy of the logic that decides which payload fulfills the pending entries and what fetch strategy each write records. Those copies are replaced by a single function, writeResponsePayloadsIntoCache. The embedded runtime prefetch stream, which previously ignored the byte offset entirely, now goes through it too. When a shell request receives more than it asked for, the extra content is at least as complete as what the corresponding non-shell request would have returned, so that's the strategy the write records: PPR for a StaticShell request, PPRRuntime for a RuntimeShell request. Previously some of these writes under-recorded, causing the scheduler to issue runtime requests for content it already had. A rejected needsRuntimeRequest row now also reads conservatively (as true) on the client, matching how the server reads the same flag. The second commit fixes an oversight where a static prefetch attempt was mistakenly skipped: when the scheduler found a cached entry that was only a shell, it deopted straight to a runtime request even though the full static response contains more and the segment's hint says a static attempt is worthwhile. A shell entry with the hint now takes the normal static revalidation path first, and the response's own signals decide whether to escalate afterward.
Showing
This diff is collapsed.
This diff is collapsed.
Please
register
or
sign in
to comment