New — Iris AI drafts your firewall, routing & rate-limit rules. Explore AI features →
Changelog
TunnelsSecurity

Response body rules run on agent tunnels too

Replace body, image optimization, compression and response edge functions now apply to responses that come through an agent tunnel, as they do on a hosted app.

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-Length up 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-Length goes out uncompressed.

Read the docs: Replace body.

Read the docs

Ask an AI to summarise this page
Deploy
App hosting Edge functions Domains & certificates
Connect
Secure tunnels API gateway Multi-region edge
Protect
Bot protection & challenge WAF & firewall Edge login
Observe & AI
Monitoring Inspector & replay Iris AI MCP server AI Gateway
Developers
Developer tools Docs ngrok policy converter Blog Changelog
Compare
Ngris vs ngrok Ngris vs Cloudflare Tunnel Ngris vs Vercel Ngris vs Netlify Expose localhost guide
More
Solutions Pricing Enterprise Sign in Get Started Free