prelinker
Prelinker provides a simple way to add preconnect and preload headers to either the response header for HTTP/2 compatible servers or via a <Link> element in the <Head> section of the HTML.
A preconnect header tells the browser that a domain will be required for page resources and that it should begin the process of connecting to the server in preparation for downloading these resources.
A preload response header informs the server to push the resources to the browser via HTTP/2 so that they will be available to browser earlier during the rendering process.
A preload <Link> is similar but informs the browser that it should begin downloading the resources as they will be required during rendering.
Page restrictions can be set for both domains and resources, for example you may want to preload a banner image on only the home page.
Release 3.x
Version 3.x is a major release with the following changes:
- Drupal 11 only: The 3.x branch drops support for Drupal 10 and requires Drupal 11.
- Visibility conditions: Preload and preconnect entities now support Drupal's condition plugin system to control when each entry is active (e.g. restrict to specific pages, roles, or request contexts).
- `fetchpriority` attribute: Preload link elements support the `fetchpriority` attribute (`high`, `low`, or `auto`) to hint the browser's resource prioritisation.