Skip to content

exit: cap initial downstream response size#139

Merged
Kianmhz merged 1 commit into
Kianmhz:mainfrom
poulcarlsen53:initial-response-ramp
May 20, 2026
Merged

exit: cap initial downstream response size#139
Kianmhz merged 1 commit into
Kianmhz:mainfrom
poulcarlsen53:initial-response-ramp

Conversation

@poulcarlsen53
Copy link
Copy Markdown
Contributor

Summary

  • cap the first downstream response for a newly opened session to 512 KiB by default
  • keep first responses urgent so setup bytes are returned without coalesce delay
  • let later responses use the normal large response budget for bulk throughput
  • add optional initial_response_bytes_pre_encode server config wiring for operators who want to tune the cap

Why

Apps Script buffers the full HTTP response before the client can decode the first byte. A huge first response can make downloads look like they take many seconds to start even when steady-state throughput is high. This keeps the first visible response small while preserving later bulk batches.

Verification

  • go test -count=1 ./internal/exit -run TestDrainAll_CapsInitialResponseOnly
  • go test -count=1 ./internal/config -run TestLoadServerInitialResponseBytesPreEncode
  • go test -count=1 ./...
  • go vet ./...

@Kianmhz Kianmhz merged commit 23090fd into Kianmhz:main May 20, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants