I have an event source on my website and I’m noticing some inconsistencies on my production and development environment. On my development environment, the connection dies as soon as I close the window. On production (Cloudflare), if I close the window the connection stays alive for what appears to be 30-60 seconds. If I refresh the page 10 times back to back, then I’ll have tons of event source connections hogging up resources. How can I prevent Cloudflare from keeping this connection open? I suppose it would also be good to mention that this issue ONLY happens on Cloudflare + chrome. Firefox, Safari, and even iOS browsers close connections instantly. When running in development (non Cloudflare), chrome returns to normal behavior and closes connections instantly as well. Here are some headers:
Also noticing that Cloudflare is stripping my connection keep-alive header, but I read this does not have to much importance in modern day.