retina.js is an open source script that makes it easy to serve high-resolution images to devices with retina displays
What the script does is loop all images and do a
HEAD request to the guessed
@2X version in order to see if it exists. On success the retina version will be loaded in. Of course you’ll need to keep your naming scheme consistent.