How to hide URL

Hello,

I run a media site where the majority of the content consists of images served via a paid CDN. Recently, I discovered that I can serve my images for free using JS Delivr. However, I’m concerned that my competitors might do the same, as the cost of a CDN currently serves as a barrier to entry in this field.

I’ve tried encoding and shortening the URLs, but they can easily be decoded and unshortened. ChatGPT suggested serving images via a proxy server, but I don’t have that option with my shared hosting account. The provided list of proxy servers seems more like VPN tools for secure browsing rather than for my specific needs.

Could you please help? How can I hide (disguise, obfuscate …) my links, such as https://cdn.jsdelivr.net/gh/user/repo@version/file, to prevent competitors from easily accessing them?

Thank you very much in advance.

Helena

Hi @Helena_G - there is no way to do this. The moment an image hits the browser, you can easily access the URL via the Chrome Dev Tools :frowning:

1 Like

Thank you, @kirupa :slight_smile:

Now, what you could do is make it very difficult for someone to save your image. You could break up the image into hundreds of smaller images and send those over the wire instead. That doesn’t prevent someone from just screenshotting the image and saving it, so it would only add some friction. It wouldn’t outright stop the copying.

1 Like

Thank you, @kirupa! :blush:
In my case, they won’t take screenshots because they need high-quality images, and taking screenshots takes time.

Currently, the images are all in a public GitHub repository and served via JS Delivr CDN. I’m very happy with the service, and it’s completely free. However, I feel a bit exposed since anyone can easily access the images via the URLs. :worried: (and steal the method)

Could you please explain what you mean by “breaking up the image into hundreds of smaller images and sending those over the wire instead”? I’ve never heard of this approach before.

Thank you very much in advance!

To protect your image URLs from being easily accessed by competitors, you can use a few strategies. One effective method is to implement URL tokens that generate unique, expiring links for each request, which helps prevent reuse. Another approach is to serve images through a script on your server that dynamically generates and proxies URLs, thus hiding the actual source. Additionally, obfuscating URL path elements, such as encoding segments or using non-descriptive structures, can make direct access more difficult. Finally, if your hosting provider supports it, restrict access to your media files through referrer checks or IP whitelisting. These techniques can help keep your image URLs concealed while using JS Delivr for cost-effective hosting.

1 Like

This is similar to how Google Maps works works where a large map is sent as smaller image tiles. Here is an example of how one person did this: How to tile very large image files - Stack Overflow

In your case, the image may not be quite that large. You are doing it to make it difficult for someone to right-click on an image once and save it to their desktop.

1 Like