Cloudflare can sometimes be one of those “hit and miss” applications. Their services are so comprehensive, that it’s very easy to overlook a configuration error. Each website needs to figure out what works and what doesn’t within its own unique environment. In this article, I’ll talk about Railgun. Ryan has already explained how to set up Railgun in a video. But does it really work? What are the caveats? Let’s find out.
Cloudflare DNS or Railgun – Don’t Enable Both
Cloudflare offers two ways to integrate with your website.
- Via cPanel and keep your DNS servers intact
- Change your DNS nameservers to Cloudflare
Choosing the second option means Railgun is problematic. You should either use Cloudflare’s DNS servers or enable Railgun. But not both. I confirmed this in tests by myself and even created a forum post to clarify. The answer is simple – if you manually change your DNS servers to use Cloudflare instead of those provided by your web host, you either lose the ability to connect to Railgun, or the implementation becomes very rocky.
As proof, here’s what happened when I finally succeeded in enabling Railgun after using the Cloudflare DNS servers:
The above is the report from the Google search console. My page download times went from 200-300 ms to over 1000 ms! Plus I started getting a whole bunch of “527” errors related to Railgun. And when I disabled Railgun, the time went back down. I was as shocked as anyone to see this happen.
This sucks hard because I love Cloudflare’s DNS servers. They are super fast. Hardly surprising, given the breadth of their network. In the end, I chose to forego Railgun, and stick with Cloudflare’s DNS.
NameHero – Partial or Full Integration
While with other web hosts you need to manually update your DNS records to those of Cloudflare, NameHero allows you to do this automatically with one click. First locate the Cloudflare icon in your cPanel like this:
Then simply enable it at the backend. Now you have the choice for full or partial integration. The full integration means you won’t be able to use Railgun. But if you choose the partial integration, it’s available.
Enabling Railgun After Partial Integration
After you’ve enabled Railgun, you can enable Railgun from cPanel in the Cloudflare settings. Like this:
Once this is done, log into your Cloudflare account, go to the “Speed” tab and scroll down. You should see something like this:
If you’ve enabled Railgun properly on the NameHero backend via cPanel, it should already be enabled now for you to use. Click “Test”. If all goes well, you should receive a successful confirmation as shown here:
How Do We Test if Railgun is Working?
There’s a quick way to test if Railgun is working or not. After you’ve enabled it, open a new window in your browser and activate the “Developer Tools” by pressing (Ctrl+Shift+C). This will open a panel. Click the “Network” tab in Chrome.
Now load the page you want to test. After it loads, click the very first URL in the “Name” column. These will bring up the response headers like this:
If Railgun is enabled, you should see the “cf-railgun” response header as shown above. Of particular interest is the second number which gives you the compressed size. In the screenshot above, you can see that Railgun has compressed the content by:
1 – 0.01 = 0.99
Or 99%! That’s a very impressive compression ratio. It’s made possible because Railgun only sends over the parts of the page that have actually changed. And when your site is mostly static, it can achieve crazy compression ratios.
Now if only it didn’t come with the terrible performance drawbacks if you choose to use Railgun with Cloudflare’s DNS servers!
I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!