15

I've created a cdn service and set the origin url to a azure website which runs iis-node that serves a NodeJS web application, when trying to access static resources the cdn always return 404 while the same pathname works when accessing the resource through the origin url,

anything that i might be missing here?

thanks!

Shachar
  • 487
  • 5
  • 15

4 Answers4

22

Turns out it takes at least an hour until the content is being populated, during that time the CDN return 404.

Shachar
  • 487
  • 5
  • 15
  • 2
    Is there a way to fallback to the original? – Edward Olamisan Feb 17 '16 at 00:43
  • @EdwardOlamisan, that's precisely what I've been thinking. Have you found a workaround for that yet? I don't understand why Azure CDN doesn't provide the fallback value by default (or at least I haven't found it yet how to achieve that effect, except for developing own solution that would require more processing for the app itself instead of having CDN to handle that properly). – walther Aug 10 '16 at 09:31
  • 2
    Thanks, you saved me from wasting another 15 minutes of recreating / reconfiguring my CDN :) – Matt Wanchap Feb 05 '18 at 02:10
  • So it's unusable then? Why they at least don't issue a redirect. – Jiří Herník Apr 20 '18 at 08:29
  • They should mention it on the portal or in the docs Thanks!! – Danny Michaeli Dec 14 '22 at 18:34
15

Based on the article

A content delivery network (CDN) is a distributed network of servers that can efficiently deliver web content to users. CDNs store cached content on edge servers in point-of-presence (POP) locations that are close to end users, to minimize latency.

Azure Content Delivery Network (CDN) offers developers a global solution for rapidly delivering high-bandwidth content to users by caching their content at strategically placed physical nodes across the world

What you can do though to fasten the process is to just log in to Azure portal, go to the CDN profiles section, pick your CDN, And Click on Purge on the top menu. It should automatically update the content of the cache memory for your endpoint/s and you shouldn't wait hours. Hope it helps. Cheers

GoldenAge
  • 2,918
  • 5
  • 25
  • 63
  • 2
    OMG, you are right! ***Purge*** immediately worked! This should be the accepted answer... – Sam Jan 03 '20 at 11:00
4

In case anyone else comes across this thread - I built an Azure CDN (Verizon Standard) and it took almost 24 hours for the images/files to pull up using the Endpoint Hostname.

Unfortunately, in my case I thought I was doing something wrong so I kept changing it which probably prolonged it. When I finally realized I did everything correct I decided to wait it out.

Mikami
  • 41
  • 1
0

I had the same issue but the cause for me was that the Azure CDN only serves content under the /CDN path. So if you are trying to access anything on http://yourdomain.com/here.jpg you'll get a 404 (unless you have a URL rewwrite in place)

Mr. Flibble
  • 26,564
  • 23
  • 69
  • 100