Browsers download incomplete file from Azure CDN

Quan Van Mai 106 Reputation points
2020-12-28T03:32:30.857+00:00

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?

Thanks

Azure Content Delivery Network
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Spilmont Erwan 11 Reputation points
    2022-05-16T14:53:03.267+00:00

    Hello,

    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.
    0 comments No comments

  2. SaiKishor-MSFT 17,236 Reputation points
    2021-01-07T07:09:29.22+00:00

    @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-https://learn.microsoft.com/en-us/azure/cdn/cdn-large-file-optimization. Please let me know if this helps. Thank you!

    1 person found this answer helpful.

  3. dmarlow 6 Reputation points
    2021-03-12T17:24:51.917+00:00

    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.
    0 comments No comments

  4. AlohaNinja 1 Reputation point Microsoft Employee
    2021-04-14T19:36:38.72+00:00

    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!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.