brian
brian

Reputation: 2775

Chrome Caching Mechanism

Help me understand what causes this:

enter image description here

And by this, I mean the fact that 100% of my assets are cached but there is still a ~200ms delay between receiving the content from the script and the DOMContentLoaded event firing. This is Chrome on Linux and the page being served up is about 100 lines of divs and things, nothing major.

Upvotes: 0

Views: 297

Answers (1)

Rob W
Rob W

Reputation: 348992

This 200ms "delay" that you're observing is not caused by the network, but by processing the content.

The delay between fetching the HTML and CSS, and between the CSS files is the time needed to parse the HTML. When JavaScript comes into the mix, the HTML parser halts until the script is loaded and until is evaluated and executed.

You can get a detailed breakdown of what affects the load timing by opening the Timeline tab, clicking on the button/circle in the upper-left corner ("Record") and reloading the page. Below is an example which shows the correlation between script execution time and resource fetching time. These screenshots were recorded in a browser profile without any extensions, if you have installed any extensions, then the times will probably increase.

Network tab:

Timeline tab:

Read more about performance and profiling:

Upvotes: 1

Related Questions