Subscribe to receive notifications of new posts:

Everybody gets WebSockets

2016-05-05

2 min read

Two summers ago, with a seemed-big-at-the-time network of 28 datacenters, not long after introducing Medellin, CloudFlare introduced support for WebSockets, initially for our Enterprise customers.

CC BY 2.0 image by Marcin Wichary

Today, with our network nearing 80 global locations, we're pleased to announce support for WebSockets for all our customers, including Enterprise, Business, Pro, and Free, with resources allocated by plan level.

What are WebSockets?

If you don't want to read RFC 6455, then this short paragraph from our previous blog post explains:

The WebSocket protocol is a distinct TCP-based protocol, however, it’s initiated by an HTTP request which is then "upgraded" to create a persistent connection between the browser and the server. A WebSocket connection is bidirectional: the server can send data to the browser without the browser having to explicitly ask for it. This makes things like multiplayer games, chat, and other services that require real-time exchange of information possible over a standard web protocol

There's a lot more technical history in that post covering how we modified NGINX to support a huge number of connections through port reuse. But the bottom line is that WebSockets are a vital technology for web sites that need to get real-time updates for features like social feeds, multimedia chat, collaborative editing, multi-player gaming, stock updates, and more.

Performance & Latency

Because the WebSocket protocol creates a single connection and doesn’t require HTTP requests, WebSockets can provide anywhere from 500:1 to a 1000:1 reduction in unnecessary HTTP header traffic, compared to HTTP polling solutions.

The server no longer needs to wait for a request to come back before it sends new data; it can simply push the data to the client the moment it has new information. Tests have shown a 3:1 reduction in latency compared to other polling solutions.

   

Modern Internet, for More People

Last week, we expanded our deep support for HTTP/2 to include Server Push. HTTP/2 was finalized as a spec in 2015, so almost a newborn child as technologies go. (We're excited to help HTTP/2 grow up fast.)

By comparison, WebSockets is already a toddler, as RFC 6455 was finalized in 2011.

But, perhaps because of complexity or expense, WebSockets hasn't seen as wide adoption as we'd expect. CloudFlare is removing those obstacles, and frankly we're curious to see what happens.

We are building a better Internet, and while that may sound like a platitude... making modern tech easy to use matters. We're eager to see what our customers do to play, grow, and thrive with another tool available.

Read more about WebSockets generally, or review details in our support article.

Cloudflare's connectivity cloud protects entire corporate networks, helps customers build Internet-scale applications efficiently, accelerates any website or Internet application, wards off DDoS attacks, keeps hackers at bay, and can help you on your journey to Zero Trust.

Visit 1.1.1.1 from any device to get started with our free app that makes your Internet faster and safer.

To learn more about our mission to help build a better Internet, start here. If you're looking for a new career direction, check out our open positions.
Speed & ReliabilityProduct News

Follow on X

John Roberts|@pencoyd
Cloudflare|@cloudflare

Related posts

September 27, 2024 1:00 PM

AI Everywhere with the WAF Rule Builder Assistant, Cloudflare Radar AI Insights, and updated AI bot protection

This year for Cloudflare’s birthday, we’ve extended our AI Assistant capabilities to help you build new WAF rules, added new AI bot & crawler traffic insights to Radar, and given customers new AI bot blocking capabilities...

September 26, 2024 1:00 PM

Zero-latency SQLite storage in every Durable Object

Traditional cloud storage is inherently slow because it is accessed over a network and must synchronize many clients. But what if we could instead put your application code deep into the storage layer, such that your code runs where the data is stored? Durable Objects with SQLite do just that. ...

September 26, 2024 1:00 PM

Making Workers AI faster and more efficient: Performance optimization with KV cache compression and speculative decoding

With a new generation of data center accelerator hardware and using optimization techniques such as KV cache compression and speculative decoding, we’ve made large language model (LLM) inference lightning-fast on the Cloudflare Workers AI platform....

September 25, 2024 1:00 PM

Introducing Speed Brain: helping web pages load 45% faster

We are excited to announce the latest leap forward in speed – Speed Brain. Speed Brain uses the Speculation Rules API to prefetch content for the user's likely next navigations. The goal is to download a web page to the browser before a user navigates to it, allowing pages to load instantly. ...