preloading

Starting to download code or data before it is needed, so it is ready by the time the user asks for it.

In more detail

Good moments are when the browser is idle or when the user shows intent, such as hovering over a button. Preloading too much wastes bandwidth.

Example

Calling a React.lazy import function early starts downloading the chunk; React reuses the same promise when the component renders.

Related terms

Taught in

References