Random bump because I currently have this question open with Cloudflare official support, and I do not want it to be auto-closed after 15 days so I can share the response with the community.
(It is really annoying to have to do that, Cloudflare.)
Cloudflare support kindly tested the current bahaviour for me, finding that it works when
running 30+ minutes, which way more than even Enterprise plan’s Error 524 limit or 6000s
This replication case confirms that:
You should be able to do SSE with Cloudflare
Error 524 only triggered if there is nothing from the server within 100s (in my replication, I keep sending every 2 seconds).
The described behaviour is certainly good enough for our use case.
There is one issue though:
For building production systems, the “undocumented feature seems to work for me today” approach is risky.
I’m following up with:
Can we get any certainty in writing that it will continue to work in the future, vs. just being an accidental implementation detail that works today but might stop any time overnight when Cloudflare changes its implementation?
This is what I mean by an “official answer”. It’s a product question.
I’m afraid we can’t guarantee whether anything will continue to work in the future.
As things might change and there are business decisions the product teams and the company need to make.
For example, support for SPDY protocol was deprecated a while ago, even though Cloudflare was one of the early adopters of SPDY protocol.
What I can assure you of, is that it’s not an accidental implementation details.
If you prefer something that officially supported, then you might want to consider WebSocket instead.
I think this makes it clear:
It’s working now, but does not have the same level of official support as e.g. WebSockets.