Image generation for lightbox
Hello,
I am new to Shopify and started to build a store. Now I am writing my own Javascript lightbox.
I need to get a list with different image resolutions so I can display in the lightbox the appropriate image according to the lightbox size. Makes no sense so serve a 1024 image to mobile device.
In liquid image generation is easy, however I was unable to access product images with different resolutions(large, grande...) from the Shopify AJAX API. What are my options here? I could set a data-attribute with the image HREF in DOM on the respective image in liquid and fetch that later on with Javascript. Will this generate a server-side performance issue? Are images generated on each request or just once and cached on the CDN?
Thank you,
Mircea