WordPress.org

Ready to get started?Download WordPress

Forums

WP Retina 2x
[resolved] retina not firing on ipad on 1st load (10 posts)

  1. synthview
    Member
    Posted 6 months ago #

    Hello!
    I can't get retina images to appear the 1st time I load them on an ipad. I've tried to put the js generating the cookie directly in the header and dequeue the external js file but it changes nothing :(

    Any idea?
    Thanks

    http://wordpress.org/plugins/wp-retina-2x/

  2. Jordy Meow
    Member
    Plugin Author

    Posted 6 months ago #

    Yes, it is normal unfortunately. Which method are you actually using?

  3. synthview
    Member
    Posted 6 months ago #

    html rewrite.

    Un other iOs devices it works form 1st load :/

  4. Jordy Meow
    Member
    Plugin Author

    Posted 6 months ago #

    Strange it works on first load... but actually it shouldn't. It's normal for now and we can't do anything about it. Browsers are evolving and soon there will be a method available that will work directly in a very optimized way. It's taking time but it's coming. I already included the src-set method but it only works with Safari and will probably not be the validated method by all the browsers. Wait and see, for now HTML Rewriter is the best imho.

  5. synthview
    Member
    Posted 6 months ago #

    maybe it would help?

    https://github.com/Darkwing371/Adaptive-Images-Uber-Extended/blob/ai-cookie-snippet.js/ai-cookie-snippet.js

    I'm using another cookie for adaptive images and it works on ipad, maybe you could compare

    document.cookie='resolution='+Math.max(screen.width,screen.height)+("devicePixelRatio" in window ? ","+devicePixelRatio : ",1")+'; path=/';

  6. Jordy Meow
    Member
    Plugin Author

    Posted 5 months ago #

    No, this script does exactly the same thing, here is no difference at all. The only difference is the name of the cookie and the fact it adds the resolution in it but it doesn't change anything for the pixel ratio.

    The pixel ratio is impossible to detect since we would need to know the physical size of the screen as well.

    This script wouldn't help to fire retina on the first load neither, not at all, this depends more on the methods on the "other side". If you use a 100% javascript method (retina.js in the plugin) it would work however.

  7. synthview
    Member
    Posted 5 months ago #

    Ok, but with adaptive images it works at 1st load, and the only js used is the one to get the cookie

  8. Jordy Meow
    Member
    Plugin Author

    Posted 2 months ago #

    Actually I would be interested in the reason (programming-wise) of why it works with them and not with the method we are using in the plugin. If you can find that it would be awesome :)

  9. synthview
    Member
    Posted 2 months ago #

    I’m not expert enough, sorry :/ but you could try to install their plugin to analyse its code

  10. Jordy Meow
    Member
    Plugin Author

    Posted 2 months ago #

    Added to my to do list...

Reply

You must log in to post.

About this Plugin

About this Topic