Skip to content

Disable buffers to fix SSE connection close issue#192

Merged
anxolin merged 1 commit intomainfrom
disable-buffers
Jan 22, 2026
Merged

Disable buffers to fix SSE connection close issue#192
anxolin merged 1 commit intomainfrom
disable-buffers

Conversation

@anxolin
Copy link
Copy Markdown
Contributor

@anxolin anxolin commented Jan 22, 2026

This PR aims to solve the connection being closed.

As suggested by @ahhda , I will try to signal nginx to disable buffers.

https://serverfault.com/questions/801628/for-server-sent-events-sse-what-nginx-proxy-configuration-is-appropriate/801629#801629

Summary by CodeRabbit

  • Performance
    • Improved real-time data streaming performance on the balances endpoint to reduce latency in data delivery.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 22, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

A single HTTP response header X-Accel-Buffering: no was added to the SSE endpoint to signal reverse proxies to disable response buffering. This ensures real-time Server-Sent Events are not delayed by intermediate proxy layers.

Changes

Cohort / File(s) Summary
SSE Endpoint Header Configuration
apps/api/src/app/routes/__chainId/accounts/__userAddress/balances/index.ts
Added X-Accel-Buffering: no response header to SSE endpoint alongside existing headers (Content-Type, Cache-Control, Connection, CORS headers) to disable reverse proxy buffering

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A header so small, yet mighty indeed,
Tells proxies "don't buffer!" with lightning-fast speed,
SSE events now flow without delay,
Real-time data dancing the DevOps way! ✨

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@anxolin anxolin merged commit c2e80bc into main Jan 22, 2026
8 of 9 checks passed
@anxolin anxolin deleted the disable-buffers branch January 22, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant