Without Pre-fetching
This example component does not exist anywhere in the DOM on page load, so the code is not retrieved by the browser.
Open up developer tools and inspect the network tab.
Clear the history to make it easier to see new requests.
Click the button and you will see a new network request for the component as it is added.
With Pre-fetching
This example component does not exist anywhere in the DOM on page load, but is pre-fetched by the browser.
Open up developer tools and inspect the network tab.
Clear the history to make it easier to see new requests.
Click the button and you will see NO network request for the component as it has been pre-fetched.
Refresh the page and try both examples again.
You may notice that even with this minimal example component there
is a slight delay adding Example 1 and none for Example 2.