Why You Should Enable CloudFlare Railgun™ On Your Website or Blog

Self Hosted is now a CloudFlare Optimized Partner and we are excited to offer the CloudFlare Railgun™ technology to all of our customers free of charge. Railgun is CloudFlare’s latest performance optimization technology that gives you significant improvements in site load times.


Railgun ensures that the connection between the Self Hosted network and CloudFlare’s network is as fast as possible. Railgun achieves a 99.6% compression ratio for previously uncacheable web objects by using techniques similar to those used in the compression of high-quality video. On average, websites and blogs utilising Railgun can expect a 1.43x performance increase.


When a request is made to a CloudFlare server for an uncached web page CloudFlare makes an HTTP connection to the origin server to request the page. It’s that HTTP connection that Railgun accelerates and secures.

Even highly dynamic websites change slowly

Railgun works by recognizing that changes in uncacheable web pages occur quite slowly. For example, during a test, the CNN.com homepage HTML was captured three times. The first time and then 5 minutes after the initial capture and finally one hour after the initial capture. The page sizes were 92,516, five minutes still 92,516 and one hour later 93,727.

CNN sets the caching on this page to 60 seconds meaning that it is necessary to download the entire page again after one minute. However, looking inside the page, not much has changed. In fact, the change between versions is on the order of 100s of bytes out of almost 100k. Here’s a screenshot of one of the binary differences between the CNN home page at five minute intervals. The yellow bytes have changed, the rest have not.


CloudFlare have ran their own experiments revealing similar changes across the web. A highly dynamic site like Reddit.com, for example, changes by approcimately 2.15% over five minutes and 3.16% over an hour. News sites such as The New York Times and BBC News change significantly slower however. The New York Times home page changes by only 0.6% over five minutes and 3% over an hour and BBC News changes by a mere 0.4% over five minutes and 2% over the course of an hour.

Although the dynamic web is not actually cacheable, it is also not changing fast at all. CloudFlare Railgun uses this fact to achieve very high rates of compression. This is not too dissimilar to how video compression looks for changes from frame to frame; Railgun looks for changes on a page from download to download.

Railgun Technology

Railgun consists of two components: the sender and the listener. The sender is installed at every CloudFlare data center around the world and the listener is a software component that Self Hosted has installed on our network for customers.

The sender and listener establish a permanent TCP connection that’s secured by TLS which is used for the Railgun protocol. Essentially, a persistent connection is opened between CloudFlare’s network and ours and eliminates the overhead of TCP.

We have made it simple for our customers to get the benefits of Railgun with one click. For additional information and instructions on how to activate, visit our Knowledgebase.