What Is Railgun by CloudFlare?
Railgun is part of a host of tools and services offered by CloudFlare that are designed to protect and improve the performance of websites. Webmasters looking to reduce load times for their websites, even those with dynamic content previously deemed "uncacheable," need to take a look at CloudFlare and Railgun.
Before getting into what Railgun is, and how it works, it would be prudent to first talk about who CloudFlare is.
Who Is CloudFlare?
CloudFlare is an organization that aims to increase the speed and security of member websites by acting as a content delivery network (CDN) and distributed domain name server (DNS). CloudFlare owns a global network of servers. When your add your site to CloudFlare your website's DNS is changed to point at the CloudFlare CDN, and the static contents of your site are cached on the CloudFlare CDN. When a visitor attempts to view your page the CloudFlare network serves up the webpage from the server that is geographically nearest to the visitor. By doing this CloudFlare saves the light-speed delays between your web server, and the visitor and serves up the website faster than it would have been served by your web server.
CloudFlare's network also discriminates against certain kinds of traffic, and in doing so helps protect your site from spammers, SQL injection attacks, and DDOS attacks. By protecting your site from questionable traffic CloudFlare clears up additional bandwidth for unique visitors - the folks you are actually trying to reach - and provides them the snappiest performance possible.
CloudFlare doesn't stop there. Since all of your traffic is routed through the CloudFlare CDN they are also able to provide detailed statistics about your site's visitors. In addition, CloudFlare can install add-ons to your site code and implement apps like Google Analytics, Google Webmaster Tools, CodeGuard, Infolinks, and many more.
Now that we have a sense for who CloudFlare is we're ready to talk about how Railgun fits into the picture.
What Does Railgun by CloudFlare Do?
As we mentioned, one component of the CloudFlare protection and optimization strategy is to route all website traffic through the CloudFlare CDN prior to reaching your web server. When you use CloudFlare all of the static content that makes up your website is stored on the CloudFlare network. This is how they're able to speed up delivery of your website to users a long way from your web server. But what about the dynamic content? What about the content that has to be retrieved from your web server? That's where Railgun comes in.
Railgun is an optimization technique that can be applied to the connection between the CloudFlare CDN and your web server. Railgun accelerates the HTTP connection between the CloudFlare server and your web server. When Railgun is enabled a permanent connection is opened between the CloudFlare CDN and your web server, and the web server only serves up changed content to the CloudFlare CDN. In doing so the vast majority of a dynamic website can be cached on the CloudFlare CDN while only the changes have to be retrieved from the web server, and since Railgun establishes a permanent, secured, and optimized connection, those changes are served up much faster than they would be over a standard TCP/IP and HTTP connection.
Sounds great right? So how do you get Railgun? Read on.
How Do I Get My Website on the CloudFlare Network, and How Do I Get Railgun?
In order to get Railgun you have to register for an account with CloudFlare and add your website to their network. The first step is to register with CloudFlare. There are two ways to do this:
- Go to the CloudFlare website and register, then add your website to your account.
- Go to your hosting account cPanel and check to see if they offer CloudFlare integration. If they do, register for an account through the CloudFlare interface and enable CloudFlare service to your website.
CloudFlare offers four levels of service. CloudFlare's free plan will speed up your site using CloudFlare's CDN, provide in-depth analytics, and offer lots of other great features. The next level of service, is the Pro level account. Pro accounts offer enhanced optimization compared to the free plan, as well as additional security features, more in-depth analytics details, and many more features.
In order to get Railgun you'll have to skip over the free and Pro CloudFlare accounts in favor of a Business or Enterprise level account. At the Business and Enterprises levels you get Railgun along with many additional optimization and security enhancements.
As of May 2015 CloudFlare's Pro account was $20 per month, the Business account was $200 a month, and the Enterprise account was $5,000 per month (on average, but a custom quote is required to purchase an Enterprise account). So if it's Railgun you're after, the starting price is $200 per month.
Alternatives to CloudFlare
If you like the idea of using a Content Delivery Network (CDN) to speed up delivery of your website to visitors, but aren't ready to sign on the dotted line with CloudFlare, here are a few alternatives to consider:
MaxCDN A CDN focused on speeding up delivery, and it does that very well, but does not offer the security enhancements that CloudFlare does.
Akamai A CDN focused on delivering industry-leading performance and customer service with a focus on large businesses. Akamai has more Fortune 1000 customers than any other CDN, but does not have an offering for smaller customers.
Incapsula The CDN that most closely resembles CloudFlare. Incapsula offers both performance and security enhancements at price points that small and medium sized organizations can appreciate.
There are many other CDN's out there, and if none of these seem to be exactly what you're looking for there's undoubtedly more options out there for you to consider.
Railgun Hosting Frequently Asked Questions
What is Railgun?
Railgun is a communication protocol developed by Cloudflare specifically for the purpose of speeding up communication between your web server and the Cloudflare CDN.
Can I get Railgun as a stand-alone service?
Railgun is a way of enhancing the connection between your web server and Cloudflare's CDN. So Railgun wouldn’t offer any benefit as a stand-alone service. In any case, Railgun isn't offered as a stand alone product or service, it is only offered bundled with a Cloudflare Business or Enterprise account.
What does Railgun do?
On average, Cloudflare is able to handle two-thirds of all website traffic requests without the help of your site's web server. However, the final one-third of requests cannot be answered by cached resources and the request must travel back to your web server.
Railgun is designed to dramatically speed up this final one-third of requests. In addition, Railgun is able to detect the parts of your site that have changed since the last data transmission and only transmit the updates.
How does Railgun speed up communication between a web server and Cloudflare?
Railgun does three things to improve communication between a web server and Cloudflare:
- Railgun establishes a permanent connection – in contrast to HTTP connections which must be renegotiated every time a new request is made.
- Railgun transmits data in binary and under very high compression, reducing the size of the transmitted content dramatically.
- A Railgun connection is encrypted and secured by TLS, ensuring maximum data security.
In all, these techniques account for a 700% improvement in connection speed when Railgun is compared to HTTP.
What are Railgun's hosting requirements?
Railgun can be installed on a web server running any 64-bit Linux operating system on which Memcache is available.
Can I get Railgun for free?
Railgun is included in Cloudflare's premium Business and Enterprise plans – both of which are quite pricey. However, there are a limited number of Cloudflare "Optimized Partners" who do provide free access to Railgun. Select one of these hosts, enable Cloudflare from your hosting control panel, and you'll have access to Railgun as an added-on feature of the free Cloudflare plan.
How do I find out if a host is an "Optimized Hosting Partner" who offers Railgun?
First, check the Cloudflare website and look for the list of hosting partners. The list breaks out providers between "Optimized Partners" and "Certified Partners." The former list of providers has access to Railgun. Second, once you've confirmed that the host is an "Optimized Partner," take a look at its documentation or touch base with its support team to find out how you can enable Railgun for Cloudflare.
Can Railgun help with dynamic websites?
Yes, Railgun was designed with highly dynamic websites in mind. If you want to use Cloudflare with a site that changes frequently, such as a news website, or a site that offers a personalized experience, such as a social network, Railgun has the potential to dramatically improve your website's performance.
How do I add my website to Cloudflare’s network?
There are two ways to do this. The easiest way is to enable Cloudflare in your hosting account control panel if integration with Cloudflare is offered by your hosting provider. If this isn't an option, just register for a Cloudflare account and they will walk you through the steps to get your site on Cloudflare's network.
Can I use CloudFlare with my existing hosting provider?
Yes. Cloudflare basically acts as a gateway between a website visitor and your web server.
If your current hosting provider doesn’t offer Cloudflare integration you can still use Cloudflare by manually adjusting the DNS settings in your hosting account. If this sounds complicated, don’t worry. Cloudflare provides instructions that will walk you through the manual setup process.
If I add my site to Cloudflare and then change my mind can I remove my site without too much trouble?
Removing your site from Cloudflare is not difficult. If your hosting provider offers Cloudflare integration you can remove your site using the Cloudflare interface in your hosting account control panel.
If your hosting provider does not offer Cloudflare integration you'll have to manually change DNS settings, and your domain name registrar should be able to help you with that. Make sure to wait at least 24 hours after changing your DNS settings prior to removing your website from your Cloudflare account to make sure your website remains available during the transition from Cloudflare's nameservers back to your hosting provider's.
Does Cloudflare ever block legitimate visitors?
One concern with Cloudflare is the way it categorizes internet traffic. If Cloudflare misidentifies a legitimate user as part of a DDoS attack or part of an attempt to circumvent site security it could block that user from accessing your site. This concern is not a widespread issue and the same issue affects all services that aim to cut down on DDoS and SQL injection attacks. However, you should be aware of this risk in the event that a website visitor contacts you about a problem.