Are images in CDN being deleted when I delete my product media file?

Are images in CDN being deleted when I delete my product media file?

TP9
Tourist
5 0 1

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.

Replies 5 (5)

David_Weru
Shopify Partner
177 16 43

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&colon;image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA
    AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
        9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />

 

TP9
Tourist
5 0 1

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.

David_Weru
Shopify Partner
177 16 43

Hello, @TP9 

Once you encode the image, you'll have a string.

 <img src="data&colon;image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA
    AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
        9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />

 

You can save that string in a javascript variable, but strip out

'data&colon;image/png;base64'

Then on your imagetag, do this:

<img onload='this.src="data&colon;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.

 

sallytrace
Excursionist
16 2 1

Is this still possible?  A lot has changed since this post.  Thanks.

Elias
Shopify Staff
3010 294 522

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