1

As I have tested in webpagetest (screenshot below) , I have seen the content download time for js and images are high. If there is any reason behinf it or else I amdoing something wrong. I have integrated hook_css_later to make preprocess false and in hook_js_alter to move the js files to footer and defer the js. What can make the js and images file content downloading time so high. Thanks in advance

enter image description here

Mainak Ray
  • 69
  • 1
  • 6

1 Answers1

0

The server is using http/2 for data transfer. http/2 uses normally just one TCP connection to an origin to handle all the data transfers. Only one resource is transferred at a time (but this is much more efficient than multiple http/1.1 connections, due to the TCP slow-start and other drawbacks of TCP).

All the requests start more or less at the same time, and they spend most of the time in "waiting for response" state, as there can only be a single http/2 stream on a wire at any given time.

Your screenshot shows a bit misleading visualization of WebPageTest, in which it looks like the resources take a lot of time to be transferred.

Since late 2018, WebPageTest better visualizes actual data transfer of the resources. See this watefall.

The actual data transfer time of resources is small, it's just that there's a big number of resources pending, as they're all requested at the same time.

waterfall

jakub.g
  • 38,512
  • 12
  • 92
  • 130