Fixing Cornerstone + Cloudflare related issues
With Thanks to: ALEJANDRO SANCHEZ
I’ve been wanting to make this doc for a long time but I’ve been working like crazy lately and haven’t had the chance to write it down until now. I suppose today’s the day so let’s give this a try 😉
CLOUDFLARE + CORNERSTONE what a pain in the ass, right? well, it doesn’t have to be.
Most of the time the ROCKET LOADER feature is the “culprit” of all this mess but hey, don’t give it (or cornerstone) a hard time, rocket loader is still a BETA feature for a reason and cornerstone uses JS, so it’s obviously affected by RL’s optimization algorithm (that’s why it’s not working for you), it’s nobody’s fault.
Most (if not all) of the time, though, these issues are easily fixed and I’m here to point you in the right direction!
Enough with the writing, though, let’s cut to the chase:
PROBLEM: cornerstone’s infinite loop when CloudFlare is active
This is due to CloudFlare’s Rocket Loader feature so you can…
Solution #1 (Recommended): Add one of these page rules to deactivate Rocket loader and pretty much all of cloudflare’s features on a specific page (or type of pages):
replace the %2A with an asterisk ( * ) and “yoursite.com” with your site’s URL WITHOUT the HTTP:// or WWW part
But… which one should you use? most of the time the first, second or the last one will do (the fourth one works if your WP install is in a subdirectory). the way to know for sure is to take a look at your URL once you open cornerstone and check your permalink structure. This is a screenshot of one of my sites’ cornerstone URL: http://prntscr.com/bn8pcm as you can see the structure fits the third example. Now you know which page rule to use, but what about its configuration? well, this hugely varies but i like to disable everything in there, so i bypass the cache, disable performance and also disable Rocket Loader.
Now, this is not a one-fits-all solution. There are many cases that require a “custom” page rule but it will probably fix your problem if you add the right one (or ones). feel free to ask me if you’re not sure of what page rule to add, just send me a screenshot like the one above and I’ll give it to you as soon as i can.
Solution #2: Try deactivating ROCKET LOADER and wait for at least 15 min before trying to access cornerstone again. Remember to clean your site and browser cache to avoid unnecessary headaches.