-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Parent: #563
Summary
Non-processable responses (images, fonts, video, `application/octet-stream`) currently pass through `handle_publisher_request` unchanged via the `Buffered` path. This buffers the entire response body in memory before sending to the client — wasteful for large binaries that need no processing.
Changes
- Add `PublisherResponse::PassThrough { response, body }` variant — signals the adapter to stream the body directly via `io::copy` into `StreamingBody` with no pipeline
- Return `PassThrough` when `!should_process` and backend returned 2xx
- Update `main.rs` adapter to handle the new variant with `stream_to_client()` + `io::copy(body, &mut streaming_body)`
- Keep `Buffered` for non-2xx responses (error pages) and `request_host.is_empty()`
Files: `publisher.rs`, `main.rs`
Expected impact
Eliminates peak memory for large binary responses (images can be 1-10 MB). Improves DOM Complete for image-heavy pages since the browser receives image bytes earlier.
Plan
See `docs/superpowers/specs/2026-03-25-streaming-response-design.md`
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels