NGINX proxy_buffering off

location /events {
  proxy_pass http://backend;
  proxy_buffering off;
  proxy_cache off;
  proxy_read_timeout 3600s;
}
Advertisement

Cloudflare

Free tier buffers. Enterprise supports SSE. Alternative: use a subdomain that bypasses CDN.

Advertisement

Nagle's algorithm

TCP delays small writes. Set TCP_NODELAY on the server socket. Combines poorly with SSE without it.