by Sean Gallagher-Feb 26, 2013 3:41 pm UTC
Like most CDNs, CloudFlare uses caching of static content at its data centers to help overcome the speed of light. But prepositioning content on a forward server typically hasn’t helped performance much for dynamic webpages and Web traffic such as AJAX requests and mobile app API calls, which have relatively little in the way of what’s considered static content. That has created a problem for Internet services because of the rise in traffic for mobile devices and dynamic websites.
“The Web is changing,” said CloudFlare CEO Matthew Prince, “with more sophisticated websites that are API-driven like true applications. And more and more content is being viewed through mobile apps–it’s not a traditional webpage that people are developing now. And the last-generation CDN tricks become less effective for API-driven sites and mobile applications.”
Railgun attacks that problem by replacing the standard HTTP connection between CloudFlare’s customer websites and their data centers with a binary protocol. The protocol is used to communicate between a “listener” application that sits on the customer’s end and “sender” software that resides at whichever CloudFlare data center is closest to the end user that is the source of the API or page request.
When the CloudFlare software receives the request, it takes the last version of the page or API response it has kept in memory and creates a hash value from it. The hash value gets sent back to the Listener, which finds the version of the page or API response that matches the hash value. It then compares that version to the current page or API response, sending back binary instructions on what has changed. This lets the CloudFlare software construct the appropriate response and send it to the end user.