Your agent sends a response's body to the edge in parts, as your app produces it. The rules that change a response's body only worked on a body the edge had whole, so on an agent tunnel they didn't change anything, and an enforced response edge function answered 502 instead.
Now the edge keeps such a response until its last part arrives, runs your rules on the whole body, and sends the result to the visitor. Nothing changes for a response no body rule matches: it still streams to the visitor as your app sends it.
What changed
- Replace body rewrites responses that come through an agent tunnel.
- Image optimization resizes and re-encodes images from an agent tunnel.
- Response edge functions see the body. An enforced function no longer answers 502 for every response.
- Compression applies to a response with a
Content-Lengthup to 8 MiB.
Good to know
- The edge keeps up to 8 MiB of a body for these rules. A larger response goes out as your app sent it; with an enforced response function, the visitor gets the function's 502.
- Replace body leaves a server-sent event stream from an agent tunnel unchanged, so it stays live. A response edge function does see all of it: the edge keeps it until it ends, as on a hosted app.
- A response sent in parts without a
Content-Lengthgoes out uncompressed.
Read the docs: Replace body.