Websockets and server side events in my application are not working anymore if cloudfare cache is enabled

We have a delivery app running behind cloudfare. Our app sends notifications to its clients using server side events and an open websocket (to each client). It was working without any problems until yesterday. The server side events now take minutes to be sent to the clients, but are sent instantaneously if we disable completely cloudfare cache (by enabling development mode).

We believe something has changed in cloudfare since yesterday as the only thing that solves the problem is the development mode. Did anyone have the same experience? Does it have any solution besides disabling the cache?

3 Likes

We have the same issue. Is the only resolution you knok is to enable the dev mode?

Just to say, enabling dev mode worked for me (I hope this is temporary). Thanks Fibonacci!

1 Like

Permanent solution is to enable Page Rule for SSE endpoint to bypass CloudFlare caching

1 Like

This worked for me. Thanks!

Thank you so much! This worked.

Seems some update hit Cloudflare yesterday. Things started to work as before without any changes form our side. Although I’m still receiving an error net::ERR_HTTP2_PROTOCOL_ERROR but the SSE is still working. Any idea as to why?

This topic was automatically closed after 30 days. New replies are no longer allowed.