Network.getResponseBody returns the whole body in one base64 blob and the cache drops anything over 2 MiB, so large downloads (images, PDFs, archives) either failed or forced the long-running server to hold the full body in memory (issue #360). Add Fetch.takeResponseBodyAsStream + IO.read + IO.close. The body is moved out of the page cache into a stream handle and delivered in bounded chunks via IO.read, then freed on IO.close, so it is held once and released after the download. Binary bodies are byte-exact (stored base64). To stream a large body, raise OBSCURA_NETWORK_BODY_BUFFER_BYTES so it is cached. This is entirely opt-in: nothing runs unless a client calls the new methods, so the default fetch/render/scrape path is unchanged (verified: obstacle course 33/33, obscura-vs-Chrome head-to-head within noise of the pre-change baseline). Fixes #360.
26 lines
641 B
TOML
26 lines
641 B
TOML
[package]
|
|
name = "obscura-cdp"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
|
|
[dependencies]
|
|
obscura-dom = { workspace = true }
|
|
obscura-browser = { workspace = true }
|
|
obscura-js = { workspace = true }
|
|
tokio = { workspace = true }
|
|
tokio-tungstenite = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
url = { workspace = true }
|
|
uuid = { workspace = true }
|
|
tracing = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
anyhow = { workspace = true }
|
|
futures-util = "0.3"
|
|
base64 = "0.22"
|
|
obscura-net = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
tokio-tungstenite = { workspace = true }
|
|
futures-util = "0.3"
|