Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1228888

    CogniSens
    Participant

    Hi,

    I signed up for a CDN service from Cloudflare. They have a feature called Rocket Loader which when enabled “Improves load time for pages that include JavaScript.”

    It seems the feature has a huge impact on speeding up my page loads for my visitors but completely blocks cornerstone. Here’s the cornerstone error:

    “Uh oh!
    An unidentifiable error is preventing the live preview from loading. Switching to Skeleton Mode.”

    I need this feature in order to provide a good experience and reduce bounce rates on my site but I would also like it if you could make it work with cornerstone so I don’t have to re-enable it when I need to work on the site.

    The feature has a manual mode which allows me to selectively edit code to approve each script manually, but since it’s opt-in and not opt-out for each script it doesn’t seem like a practical solution or even possible to do for every plugin and script in wordpress in order to exclude cornerstone.

    Here’s a copy/paste of there Rocket Loader help text in case it’s useful to you:

    What does Rocket Loader do?

    Rocket Loader can improve load times for pages that include JavaScript. Your search engine ranking may be improved by reducing page load time.

    Rocket Loader improves page load times by:

    Decreasing the number of network requests by bundling JavaScript files, even third party resources, to avoid slowing down page rendering
    Asynchronously loading scripts, including third party scripts, so that they do not block the content of your page from loading immediately
    Caching scripts locally (using LocalStorage, available on most browsers and smart phones) so they aren’t refetched unless necessary

    What Rocket Loader setting should I use?

    Automatic: Optimize all JavaScript resources on your website. No configuration required
    Manual: Selectively enable Rocket Loader for individual scripts. Add the following attribute to the script tag for each script where you want to enable Rocket Loader:
    data-cfasync=”true”

    Note: The ‘data-cfasync’ attribute must be added to the HTML script tag before the ‘src’ attribute (adding the attribute via JavaScript is not sufficient).

    Rocket Loader is considered Beta because it’s an experimental feature that modifies the loading and execution flow of Javascript. While efforts are taken to increase Rocket Loader’s compatibility with third-party Javascripts, not all scripts work with this feature. Issues with Rocket Loader affect only a small percentage of customers.

    #1228889

    CogniSens
    Participant

    Ha, just realized I misspelled cornerstone in the thread title, don’t know how to fix it though.

    #1229356

    Rupok
    Member

    Hi there,

    The Cornerstone builder takes place on the front end, so sometimes Cloudfare tries to cache its resources. This can cause stale data to be loaded. To resolve this, you’ll need to disable Cloudfare when the builder is in use. This won’t effect front end performance at all.

    1. Log into CloudFlare and navigate to “Page Rules”
    2. Add a new rule using this URL pattern: *.example.com/*?cornerstone=1
    3. Under custom caching, enable “Bypass cache”
    4. Turn Performance “Off”

    If you’re still having issues editing a page, you may need to login to Cloudfare again and purge the cache.

    Hope this helps.

    #1230161

    CogniSens
    Participant

    No, it didn’t work. I already had similar rules actually that I thought might help.

    Literally the only thing that allows cornerstone to load is disabling Rocket Loader. I’ve tested it, this is the only variable I need to change in order to use cornerstone.

    For some reason I can’t seem to get my page rule to turn off rocket loader using *.example.com/*?cornerstone=1 and get it to load that way, it seems it needs to be off globally.

    #1230329

    Rupok
    Member

    Hi there,

    You can try the rule *example.com/*?cornerstone=1*

    Not that it’s a known issue with Rocket Loader and page rules works for most of the users if you follow some threads on our forum :

    Cornerstone not working with Cloudflare

    Not Loading Properly Soon after Enabling Rocket Loader

    BUG: Cornerstone + CloudFlare Rocket Loader = Not Working

    Thanks!

    #1232046

    CogniSens
    Participant

    Figured it out, this is what you need in order to use cornerstone with rocket loader and cloudflare:

    *mysite.net/*?cornerstone* (allows for editing the homepage)
    Cache level: Bypass
    Rocket Loader: Off
    *mysite.net/*/*?cornerstone* (allows for editing subpages & blog posts (you might need another /* depending on your wp settings)
    Cache level: Bypass
    Rocket Loader: Off

    #1232050

    Nico
    Moderator

    Thank you so much for sharing. It will really help others.

    Have a wonderful day! 🙂