Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I want to confirm that if I delete the image from the product page (the media file), that the image will eventually be gone from CDN - and this is just 1 url, not 2. At least this is what I was told by CS. Some of my images are hot linked, and I am tired of sending DMCAs - too many urls, and some are still showing up even after reporting.
Does anyone know the answer for sure? Thank you.
Hello @TP9
Another way to avoid image hotlinking would be to store the images as sectioned base64 text files. Then just split up the encoded image and piece it together in the src.
example base64 image:
<img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />
Hi, Trailblazer
Thank you, I found a base-64 image encoder.
A couple of questions:
How does it protect the images from theft?
Second, assuming it works, how do I do this in Shopify, where you just upload the media to the Shopify CDN?
Thanks.
Hello, @TP9
Once you encode the image, you'll have a string.
<img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />
You can save that string in a javascript variable, but strip out
'data:image/png;base64'
Then on your imagetag, do this:
<img onload='this.src="data:image/png;base64"+base64_js_variable;' />
The image will be visible but sourceless. Hotlinking will be impossible so someone will have to save your image on their computer first, and actually host it themselves proving actual theft.
That will also take out cdn copies from the mix as your images won't register as images. That said, your images will lose some file size benefits native to the actual file formats, but nothing major.
If you'd like further assistance implementing this just let me know.
Is this still possible? A lot has changed since this post. Thanks.
Hey, @sallytrace.
Thanks for joining the thread.
The CDN cache is set for 1 year so the CDN URL could continue being functional for up to a whole year. However, if you need to get a CDN URL purged and deleted, the you can get in touch with us via the Shopify Help Center.
If you have any other questions on this topic, then don't hesitate to let us know.
Elias | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025