Skip to content

The Hidden Cost of `return new Response()`

Avatar of Mathias Arlaud Mathias Arlaud

Most Symfony applications buffer everything: Doctrine results, serialized objects, JSON, exports. They build the entire response, then send it. This works fine, until it doesn't: memory spikes, time-to-first-byte creeps up, and exports start dying in production.

LLMs make the problem impossible to ignore. When a model takes several seconds to answer, waiting for the return means staring at a spinner the whole time. Streaming isn't a back-end optimization anymore. It's the foundation modern user experience is built on.

In this talk, we tear down an assumption baked into most Symfony apps: that a response has to be fully built before it's sent. We'll rethink the data flow end to end, StreamedResponse, incremental JSON encoding with the JsonStreamer component, iterable Doctrine data sources, Server-Sent Events, and EventStreamResponse for real time.

You'll walk away knowing how to stream data as it's produced, power live interfaces, generate exports of several million rows, and keep memory flat, using tools already sitting in Symfony.

Delivered in English

Date/time to be announced