RubenBristian saidI know, but it would be so easy if we could
Pirenko saidyou can’t detect retina via php
To avoid that caching issue why don’t we use a PHP session for that? Each time a retina device opens the page a session is created setting a PHP variable to true. This should fix that, right? I’m currently coding a solution with sessions that seems to be working…

My idea at this moment is:
1) Page loads and with javascript we check if it’s a retina display.
2.a) No retina display and the pages loads normally;
2.b) Argh! It’s a retina display! We create a PHP session and store a PHP variable saying that. The next time the page loads we have this variable on the header and we can add classes to images or resize them accordingly.
To avoid that caching issue why don’t we use a PHP session for that? Each time a retina device opens the page a session is created setting a PHP variable to true. This should fix that, right? I’m currently coding a solution with sessions that seems to be working…
RubenBristian saidThanks. I’m still searching for a “perfect solution”, but this seems to be the better a approach now. Thank you all for your valuable inputs
@Pirenko Yes, you’re right. Static images embedded by authors which are not thumbnails or sliders or galleries or whatever you make for them will not be retina ready. You can’t have a perfect solution..

RubenBristian saidOk, Thanks! This makes sense, but there will still be trouble with other type of images across the website (ex. on static pages where the user wants to show a “static” image).
Pirenko saidThe logo is a different story. Just provide the user the option to upload 2 logos and specify the width of the small logo, then do the switch in CSS. The logo is an exception from what i’ve wrote earlier..
premitheme saidThis starts to make sense now, but I see a problem… Let’s grab an example: the theme logo. The user has to upload it in the size he wants it to be displayed (instead of a larger size to be shrinked) so how will you handle these cases? The cases on where the image maximum size is the size you want to use on the frontend?
No, HiRes images will be served only when retina display is detected. Retina display will be detected using javascript, when detected a cookie will be generated then you can use php conditional statement to check the existence of this cookie, if it’s existing then generate image with x2 size (using one of the available image resizing scripts/technics) otherwise generate image with normal size. But to be sure that the x2 size will look sharp you need to upload already big images to the WP media library.
Final question if someone still can stand the pain: for the logo example is it enough to provide a simple image that has 144 ppi and provide it on the original dimensions on all screen types?
premitheme saidThis starts to make sense now, but I see a problem… Let’s grab an example: the theme logo. The user has to upload it in the size he wants it to be displayed (instead of a larger size to be shrinked) so how will you handle these cases? The cases on where the image maximum size is the size you want to use on the frontend?
No, HiRes images will be served only when retina display is detected. Retina display will be detected using javascript, when detected a cookie will be generated then you can use php conditional statement to check the existence of this cookie, if it’s existing then generate image with x2 size (using one of the available image resizing scripts/technics) otherwise generate image with normal size. But to be sure that the x2 size will look sharp you need to upload already big images to the WP media library.
I’m sorry to ask again, but can someone clarify if according to RubenBristian and Enabled method will the normal screens will be served with those high res images too? If this is true it seems to be a poor solution in terms of bandwidth usage…
You need to server “retina images” only for retina displays. There’s no need to double everything on the site! You can simply check if the user is on a retina display with js, store this with a cookie and server double images via an image resizing plugin..Sorry if I was unclear… I was talking about the method above suggested by RubenBristian.
But, according to this method, we have to upload only high res images, right? If this is correct, will the normal screens will be served with those high res images too?
Great stuff! Waiting for this log time ago… Thanks 
This might sound a bit dumb, but did you activate the child theme?
