How to make directories invisible as images and js in the source of the browser

Hi,

I see many sites where directories such as a images , js ,var/cash/ are not visible in the browser source. All you can see is the index. Sites where you can’t see these directories all use CDN. How do they achieve this ? For example, in https://www.houseofcb.com/ all the media had been moved in http://d166chel5lrjm5.cloudfront.net/.

thank you in advance

The media was moved to another place by simply linking images there. In the website’s HTML, images are referenced with the full URL of the image like so:

<link href="https://d166chel5lrjm5.cloudfront.net/skins/celebboutique/customer/css/ui/jqueryui.css?vz1" rel="stylesheet" type="text/css"/>

Instead of something like “href=”/style/jq.css"`.

In general, there really isn’t a functional reason to do this, and it actually makes your website a bit slower as it’s an extra DNS round-trip, which could slow down page loads by 50+ milliseconds. In either case, Cloudflare doesn’t offer this functionality right now.

1 Like

Thank you for your answer

Is it possible to replace all the url of http://example.com/images/*.* to http://mycdn.com/images/*.* ? So that user loads the images from my CDN server?

example website with Cloudflare https://www.trendyol.com/
image from trendyol https://cdn.dsmcdn.com/mnresize/1000/-/ty185/product/media/images/20210930/10/137642770/243813825/1/1_org_zoom.jpg