Title: Defer CSS   Cloudflare Rocket Loader
Last modified: August 24, 2016

---

# Defer CSS Cloudflare Rocket Loader

 *  [natostanco](https://wordpress.org/support/users/natostanco/)
 * (@natostanco)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/defer-css-cloudflare-rocket-loader/)
 * Deferred CSS is not loaded when utilizing cloudflare rocket loader, generally
   rocket loader causes troubles with any script relying on window.load sadly.
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/defer-css-cloudflare-rocket-loader/#post-6108299)
 * the code actually prefers to listen to the domcontentloaded event;
 *     ```
       if(window.addEventListener){
        window.addEventListener('DOMContentLoaded',deferredCSS,false);
       }else{
        window.onload = deferredCSS;
       }
       ```
   
 * But I guess the same problem applies? Does Cloudflare suggest another event to
   tie into for this purpose?
 * frank
 *  Thread Starter [natostanco](https://wordpress.org/support/users/natostanco/)
 * (@natostanco)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/defer-css-cloudflare-rocket-loader/#post-6108466)
 * I don’t think, it is supposed to emulate window events normally but apparently
   it has a lot of quirks
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/defer-css-cloudflare-rocket-loader/#post-6108467)
 * In that case maybe you’d better log a ticket at Cloudflare’s instead, no? 🙂
 * frank
 *  [AJ @ WpFASTER.org](https://wordpress.org/support/users/ajm_1976/)
 * (@ajm_1976)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/defer-css-cloudflare-rocket-loader/#post-6108469)
 * Hi natostanco,
 * CloudFlare is great; but Rocket Loader… not so much.
 * Rocket Loader only ‘works’ in select browsers; is not recognized by Google Bot;
   will (almost always) degrade page-to-page navigation/transition load times (since
   the browser is unable to cache RocketScript .JS); is still in BETA (will work
   one day, not the next); and is, at least for dynamic WordPress sites, a ‘hammer’
   instead of ‘scalpel’ — it’s pretty much all-or-nothing, on or off, unless you
   know PHP backwards and forwards.
 * Ideally, you’ll want to make use of Frank’s plugin to defer/asynchronously load
   your JavaScript. Then, of course, deferred CSS will load properly. (Not to mention
   all of the other benefits of utilizing ‘universally’ recognized HTML 5 script
   attributes).
 * Best,
    AJ

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Defer CSS Cloudflare Rocket Loader’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [AJ @ WpFASTER.org](https://wordpress.org/support/users/ajm_1976/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/defer-css-cloudflare-rocket-loader/#post-6108469)
 * Status: not resolved