| Roundtrip response time: | ||
Examples 6, 7, and 8 all contain the following components in this order:
- a 2 second script
- an iframe containing a 10 second script
- a 2 second script
- a 2 second script
Recalling that browsers block parallel downloads, we might expect this page (including the iframe) to take 16 seconds to load.
In reality it takes ~12 seconds to load.
That's because components in an iframe can be downloaded in parallel with components in the parent document.
The first script is downloaded (total = 2 seconds).
The iframe's 10 second script is downloaded (total = 12 seconds).
While the iframe's 10 second script is downloading, the parent documents last two 2 second scripts are downloaded in parallel with the 10 second script.
We've achieved parallel downloads of scripts, which is great.
But it's too bad the script inside the iframe blocks the parent's onload event from firing.