The header image for the 'Disqus and Cloudflare' post, sorry the platform doesn't allow alt text on headers

Disqus and Cloudflare

The comments section of this site uses the third party Disqus system; it looks after the storage, moderation, management, and spam filtering of comments for me. The entire website is run through the Cloudflare system; providing the SSL Certificate, web application firewall, caching layer, edge node scripts, etc. Unfortunately, by default, these two systems do not play well together.
rocketloader-min

Rocket loader is one of Cloudflare's performance improvements; it decreases the window load time by optimizing any javascript contained within the page (bundling and reducing the number of external calls in the page load). Unfortunately, when Rocket Loader does its magic on the script used to load Disqus it breaks the script. The quick solution is to disable Rocket Loader on any site that uses Disqus, but there is another option.

When Cloudflare encounters a script tag containing the attribute 'data-cfasync="false"' it skips optimizing them. Place this into the Disqus loader on your site and you will find that Cloudflare and disqus start to play together well.
script-min

Thank you to NASA for providing the header image for this post on unsplash.com.

About James Chorlton

I am a software developer from the South-West of England; I mostly work in .NET (c#) creating desktop, web, service, and backend software for the Legal and Health markets.

Comments