Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author bjornjohansen

    (@bjornjohansen)

    Thanks for reporting this Axel. I get the same results as you do on your site, but I can not recreate the bug on my own test site.

    I’ll see if I can fix this ASAP.

    Thread Starter AxelPiskulic

    (@axelpiskulic)

    Hello Bjørn,

    I found that the problem was related with CloudFlare service (I use the free CloudFlare service in my sites).

    In CloudFlare settings, in the “Performance settings” tab, there is an option named “Rocket Loader (Web optimization)”. If I deactivate this feature, BJ Lazy Load plugin works OK with all browsers, as usual, and also with Safari.

    About this “beta” feature, CloudFlare says that it “Automatically asynchronously load all JavaScript resources”.

    I also use the minify option (in CloudFlare) for JS, CSS and HTML files, but this option doesn’t cause problems.

    Also I changed the “Theme loader function” (in BJ Lazy Load settings) from “wp_footer” to “wp_head”, because during the test in some cases the option wp_footer caused BJ Lazy Load plugin didn’t work.

    Thank you again for your plugin!

    Axel

    Thread Starter AxelPiskulic

    (@axelpiskulic)

    Hello,

    Just in case, in the CloudFlare support section I found this tip when you want Rocket Loader ignore individual scripts (without the need to deactivate the Rocket Loader feature) by putting data-cfasync=”false” in the script tag:

    https://support.cloudflare.com/entries/22063443–How-can-I-have-Rocket-Loader-ignore-my-script-s-in-Automatic-Mode-

    Here another example:

    https://support.cloudflare.com/entries/22066216-How-do-I-use-Rocket-Loader-with-TypeKit-

    Thank you again Bjørn!

    Axel

    Plugin Author bjornjohansen

    (@bjornjohansen)

    Great Axel! Thanks for your research and feedback 🙂

    Thread Starter AxelPiskulic

    (@axelpiskulic)

    Hello Bjørn,

    Please, could you tell me if it is possible to insert the parameter data-cfasync=”false” in the BJ Lazy Load script tag. I think perhaps people that use your plugin is interested in Cloudflare service too (and with the Rocket Loader feature in particular) because both are ways to reduce load time for a website.

    Thank you very much,

    Axel

    Thread Starter AxelPiskulic

    (@axelpiskulic)

    Hello,

    It is not a good solution but I inserted data-cfasync=’false’ in the BJ Lazy Load script by adding this code to my functions.php file:

    function rocket_loader_attributes( $url )
    {
    $ignore = array (
    
    'http://www.amarseaunomismo.com/wp-content/plugins/bj-lazy-load/js/combined.min.js?ver=0.6.10',
    
    );
    if ( in_array( $url, $ignore ) )
    { // this will be ignored
    return "$url' data-cfasync='false";
    }
    
    return $url;
    }
    add_filter( 'clean_url', 'rocket_loader_attributes', 11, 1 );

    This code works OK, but CloudFlare doesn’t ignore the script. I found people with similar problems in some forums: http://stackoverflow.com/questions/15323986/cloudflares-rocket-loader-wordpress-ignore-scripts

    I opened a ticket in CloudFlare about this…

    Axel

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Images not shown with Safari desktop browser’ is closed to new replies.