Does Cloudflare accelerates websockets?

  1. Will Cloudflare accelerate my websocket data transfer speed by default (without any additional configurations)?

  2. What paid and free configurations can I use to improve my websocket connection? Will Argo help here?

  3. What level of performance increase should I wait from these different configurations?

p.s. I know that CDN mostly concentrates about optimizing serving of static content but still I am curious will it help at least a bit with dynamic content?

  1. In general no, sometimes it’ll increase by maybe 5-10 milliseconds due to how Cloudflare works as a proxy and may add latency between the visitor and your origin. Actual data transfer speed may vary, however Websockets generally aren’t great for sending megabytes of data through so it shouldn’t be much of an issue with small, event-driven data.

  2. Argo/Cloudflare Tunnel will likely speed up the connection time with it’s smart routing. Note that free accounts can only support a small amount of websocket connections at a time, while paid plans will grant you more connections at a time.

  3. see 1

By default dynamic content isn’t cached (to prevent issues where one visitor sees another visitor’s account info) so if you want dynamic content cached, make sure to set your Cache-Control headers accordingly, and follow the following article to caching static html:

https://support.cloudflare.com/hc/en-us/articles/200172256-How-do-I-cache-static-HTML-

Thanks! So, just to be clear. I use only Cloudflare - I have a little bit of additional latency and longer packets transport time. I use Argo and I gain lower latency and faster packets transport time. Is that right?

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