Why do I read that I have to modify code to use the CDN?

I was reading about CDNs and Why do I read that I have to modify code to use the CDN? People are saying you need to point files such as example.com/image1.jpg to somecdn.example.com/image1.jpg

Does cloudflare just handle all this for you since they are doing name servers as well?

Which code? You only have to point your domain to the nameservers given to you by Cloudflare and thats it.

yeah that’s great to hear. Because when I was researching on CDNs, people were saying you need to modify your code and point images and other static files to CDNs. For example this article from 2016:

That is referring to CDNs, where you host your resources on third party domains.

Cloudflare is a reverse proxy, so all traffic is routed through them, so they provide that CDN functionality without you needing to change any code. Hosting third party assets on a CDN whilst using your own origin server would require changing code to point to the assets on the CDN. Which is why Cloudflare is so awesome! No code changes required :slight_smile:

2 Likes

This topic was automatically closed after 31 days. New replies are no longer allowed.