Lazy Parsing: Zero Overhead by Default
In traditional frameworks, global body-parsing middleware reads and parses incoming request streams for every request—even when a route does not require a payload (such as GET or HEAD requests).
Volten takes a lazy, on-demand approach:
- Incoming streams are not buffered or parsed until you explicitly call
await ctx.body()or consumectx.bodyStream. - Requests with
GETorDELETEmethods automatically return empty objects or strings without reading streams. - If an endpoint does not read the body, no CPU cycles or memory buffers are wasted.