Chrome network Timing , how to improve Content Download Chrome network Timing , how to improve Content Download google-chrome google-chrome

Chrome network Timing , how to improve Content Download


I can't conclusively tell you the cause of this, but I can offer some variables that you can investigate, which might help you figure out what's going on.

Caching

I know you said that the data is not getting cached at the browser level, but I'd suggest checking that again. Because the fact that the initial request takes 2s, and then the repeat request only takes 2ms really does sound like caching.

How to check:

  1. Go to Network panel.
  2. Look at Size column for the request. If you see from memory or from disk cache, it was served from the cache.

size column

Slow development server or machine

My initial thought was that you're doing more work on your development machine than it can handle. Maybe the server requires more resources than your machine can handle. Maybe you have a lot of other programs running and your memory / CPU is getting maxed.

How to check:

  1. Run your app on a more powerful server and see if the pattern persists.

Frontend app is doing too much work

I'm not sure this last one actually makes sense, but it's worth a check. Perhaps your Angular app is doing a crazy amount of JS work during the initial request, and it's maxing out your CPU. So the entire browser is stalling when you make the initial request.

How to check:

  1. Go to Performance panel.
  2. Start recording.
  3. Do the action that causes your app to make the initial request.
  4. Stop recording.
  5. Check the CPU chart. If it's completely maxed out, then your app is indeed doing a bunch of work.

CPU chart

Please leave a comment and let me know if any of these helped.


I have also been investigating this issue on Chrome (currently 91.0.4472.164) as the content download times appear to be vastly different based on the context of the download. When going directly to a resource or attempting to update rendered content as the result of a web call, the content download time can take up to 10x the duration when made from other client applications or when simply saving the data off as a variable in Chrome.

I created a quick, hacky Spring Boot web application that demonstrates the problem that I have made public on github: https://github.com/zielinskin/h2-training-simple

The steps in the readme should hopefully be sufficient to demonstrate the vast performance differences.

I believe that Chrome will need to resolve this performance issue as it has nothing to do with the webserver or ui framework being used.