(I am unsure whether this is the correct site for this question. If it is, please feel free to remove this disclaimer, otherwise just ping me, I will move and delete it then...)
We are deploying an angular application that has been created using the Angular-CLI toolset to an Azure WebApp. Loading a static file with about 500 KB from a browser takes a good seven seconds in this setup.
When delivering the same file using an ASP.NET Core web application and the app.UseStaticFiles()
middleware, the load time drops to less than 200 ms.
Am I missing something about Node.js serving static files here? Can anyone point me at what we did wrong here?
We found the problem. The app is hosted using IIS and not with Node.js. It's the way how IIS transfer and compress the JS files, see the answer here: Azure Website slow to serve static JS/CSS but not binary
We added the following line to <system.webserver>
in web.config
<serverRuntime enabled="true" frequentHitThreshold="1" frequentHitTimePeriod="00:00:20" />
which solved the problem (~8-10 seconds to now ~200 milliseconds).