What would be the best way to synchronize folders and sub folders with Azure CDN

1k views Asked by At

I'm evaluating Azure CDN, which seems like it can be a great solution... but for some reason they tried to make it as complex as possible to use...

So, I was thinking to create a Windows service that uses something like FileSystemWatcher to monitor specific folders, that way, maybe I can make it transparent to the programmer, so every image that is being added / uploaded through FTP / uploaded by a web user will automatically be uploaded to the Azure CDN through their super complex APIs...

Assuming every file is created/updated/deleted on the Azure CDN as well, I'm thinking I could use the reference to the Azure CDN in order to render the image.

I also wonder how can I use a fallback for images - for example, lets say an image was uploaded but it takes 10 seconds for it to get to the CDN and maybe more time to replicate to all geographic locations - in that case, maybe I can load it locally for the first 10 seconds and then use the CDN URL... any suggestions?

  1. Is there a solution that already does that synchronization?
  2. Can you think of any issues with implementing something like that?
  3. How long it would take for the images to get published before it is safe to use them?
1

There are 1 answers

3
Erik Oppedijk On

The Azure CDN is filled automatically by the first request (pull model) at each CDN location, so to answer your questions:

  1. Azure does this automatically
  2. You could send a request from different locations around the world to pre populate, difficult to implement
  3. Image's are directly available, although the first request could take some extra time as the image is not yet in the CDN location, so a call to the source (storage/website/cs) is done

Filling all the CDN without knowing if there is traffic coming from these regions could be more expensive, read my old blog post on this: http://blogs.infosupport.com/using-azure-cdn-and-bing-maps-and-cache/