Large profile pictures of users, models and channel webhooks (animated ones, or ones set through the API) were sent out in thousands of small pieces, each handled separately, and the knowledge base export sent its zip file the same way. A 2 MB picture took around 200 to 400 ms to load, 20 loads of it at once, as on a page full of avatars, took 9 to 15 seconds, and an 8 MB export spent close to a second just sending the file. Both are now sent as one complete response with the same content type and headers, plus a size header in place of chunked sending.
| Picture | One load before | One load after | 20 at once before | 20 at once after |
| --- | --- | --- | --- | --- |
| Model, 2 MB | 207 ms | 15 ms | 9.3 s | 0.48 s |
| User, 2 MB | 379 ms | 15 ms | 15.0 s | 0.34 s |
| Model, 5 MB | 743 ms | 39 ms | 33.6 s | 0.63 s |
| User, 5 MB | 627 ms | 25 ms | 30.7 s | 0.54 s |
Fixes#34597