Skip to main content

DEFAULT_MAX_BUFFERED_BODY_BYTES

Constant DEFAULT_MAX_BUFFERED_BODY_BYTES 

Source
pub const DEFAULT_MAX_BUFFERED_BODY_BYTES: u64 = _; // 67_108_864u64
Expand description

Default ceiling for the in-memory serve_file_response path when Server::max_buffered_body_bytes isn’t set explicitly. Files larger than this cap are rejected with 503 Service Unavailable rather than allowed to drive the server’s RSS to N × file_size on N concurrent requests.

Truly large files need a streaming response path that writes directly to the wire instead of materialising a Vec<u8> body. streaming::ChunkStream provides the building block; wiring it into Response requires a ResponseBody enum which is a public API change parked for v0.1.

64 MiB covers the vast majority of static-asset workloads (HTML, JS bundles, images, small video previews). Override per-deployment via ServerBuilder::max_buffered_body_bytes.