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