2

I am new to Azure CDN. Basically, I am trying to use CDN for my php website images, javascript files and css files.

I have created an Azure blob storage, then I added one container and started adding file to that container. I noticed that each file is accessible via a url something like this https://*******.blob.core.windows.net/content/Test1.jpg

Thats it!. I guess that is what I wanted. But, now question is; where CDN comes to play? I see that we can create a CDN and then add endpoint to that CDN that will further point to Blob Storage that I have created earlier. But, question is, why I would need to create that CDN and its end point while I am already able to access my file thru url that is provided by Azure Storage?

1 Answers1

1

When people access to your website for the first time, Verizon/Akaimai or your selected CDN provider will cache your static files in the closest source possible, the next time that users from the same region access your website, the static files are served from the point of presence of your CDN provider that is closest to them. This not only reduces latency when delivering files to your users but also reduces load and bandwidth usage in your server.

It's really well depicted here:

CDN

  1. A user (Alice) requests a file (also called an asset) by using a URL with a special domain name, such as .azureedge.net. This name can be an endpoint hostname or a custom domain. The DNS routes the request to the best performing POP location, which is usually the POP that is geographically closest to the user.
  2. If no edge servers in the POP have the file in their cache, the POP requests the file from the origin server. The origin server can be an Azure Web App, Azure Cloud Service, Azure Storage account, or any publicly accessible web server.
  3. The origin server returns the file to an edge server in the POP.
  4. An edge server in the POP caches the file and returns the file to the original requestor (Alice). The file remains cached on the edge server in the POP until the time-to-live (TTL) specified by its HTTP headers expires. If the origin server didn't specify a TTL, the default TTL is seven days.
  5. Additional users can then request the same file by using the same URL that Alice used, and can also be directed to the same POP.
  6. If the TTL for the file hasn't expired, the POP edge server returns the file directly from the cache. This process results in a faster, more responsive user experience.
Gabriel Talavera
  • 1,377
  • 1
  • 11
  • 18