Browsers download incomplete file from Azure CDN

Quan Van Mai 106 Reputation points

Recently, I have encountered a problem with Azure CDN. Occasionally, browsers download incomplete files that are cached in Azure CDN.
That leads to our web page is being displayed correctly or shown as blank page.
We have checked the browser's console, and it is "Uncaught SyntaxError: Invalid or unexpected token".
It seems like the browsers cannot compile the javascript files returned from CDN.

Every time the issue happens, we cannot do anything but purge all cached files in the CDN, and it disappears.

For more information:

  • We are using Angular 5 and our web page is hosted in an Azure Web Service.
  • We are using Azure CDN from Microsoft.
  • Optimization strategy is "General web delivery". It is the only option in our subscription.
  • When the problem occurs, it happens for all new users in the same region who try to access our Web app while people in other regions are still accessing it fine.
  • We must purge all caches files in the CDN to solve it "temporarily".

Has anyone run into this issue?


Azure Content Delivery Network
No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Spilmont Erwan 11 Reputation points


    Do you have any updates concerning that issue?

    We have exactly the same problem as QuanVanMai-2303: we experience 404 and uncomplete download of the ressources stored onto the CDN.
    It translates to a blank page on our frontend and it appears pretty much randomly on any geographic location.

    2 people found this answer helpful.
    No comments

  2. SaiKishor-MSFT 16,336 Reputation points Microsoft Employee

    @Quan Van Mai Apologize for the delay in response to your question.
    Looks like this issue may be due to large file transfers. We don't have any limit on large files but to achieve this we need to implement object chunking- Please let me know if this helps. Thank you!

    1 person found this answer helpful.

  3. dmarlow 6 Reputation points

    We too have been seeing this with the Azure/Microsoft CDN. Here's what Azure support and respective "backend team" were able to discover:

    When the first byte of the response is fetched from the Parent cache we were seeing this Issue, Our backend team Recovered the parent cache having system failures.
    Currently issue is mitigated and we are still waiting for an RCA, Once I have any update will share with you.

    We have several Verizon CDN endpoints and haven't seen this issue ever.

    1 person found this answer helpful.
    No comments

  4. AlohaNinja 1 Reputation point

    We just witnessed this same behavior multiple times this week using Premium Verizon CDN - it's not related to app deployments or file size (<1MB).

    The edge pops cache a 0 content length payload in specific regions. When navigating to the resource in chrome it downloads the file (content-type is incorrectly set to application/octet-stream) of 0 bytes. The only solution is to purge the profile which forces a re-validation to the origin and the situation is resolved.

    This does not seem to be caused by origin timeouts or errors - we have no data logs corresponding to the outage timelines.

    We are considering migrating to another CDN provider - there is nothing our app is doing improperly. We are testing shortening our TTL from 10m to 5m to see if the situation improves.

    Update - we did find a route config that was responding with 0 byte 200 which the CDN was caching - this was a bug in our routing proxy, not the CDN or the app. Good luck to others!