Preload Configuration
Declare global resource preload hints that are injected into the <head> of every storefront page. Preloading a critical asset (for example the hero image or a web font) tells the browser to fetch it early, which can improve Largest Contentful Paint and reduce layout shift.
Overview
The Preload section lets you add <link rel="preload"> tags without editing theme templates. Each row you add becomes one preload link, built from a resource reference and a free-form attribute string.
Configuration
Configuration Path: Stores > Configuration > Magebit > Preload > General Settings
| # | Field | Default | What it does |
|---|---|---|---|
| 1 | Global Pre-Loads Enabled | No | Master switch, Yes / No. When off, no global preloads are emitted. |
| 2 | Global Pre-Loads | Empty | The table of preload links to inject. Each row has an Href and an Attributes value. |
Config paths:
preload/general/global_preloads_statuspreload/general/global_preloads
The Global Pre-Loads table has two columns, both required:
- Href - the resource to preload. This can be a full URL, or a Magento view-file path such as
Magento_Theme::images/hero.webp. A view-file path is resolved to its static URL automatically. - Attributes - a raw attribute string appended to the link tag, for example
as=image fetchpriority=high media=(min-width:768px).
Usage
- Go to
Stores > Configuration > Magebit > Preload > General Settings. - Set Global Pre-Loads Enabled to Yes.
- Under Global Pre-Loads, click Add New Preload and fill a row, for example:
- Href:
Magento_Theme::images/hero.webp - Attributes:
as=image fetchpriority=high media=(min-width:768px)
- Href:
- Save the configuration.
The row above renders into the page head as:
html
<link rel="preload" href="/static/.../Magento_Theme/images/hero.webp" as=image fetchpriority=high media=(min-width:768px)>Notes
- All settings are scopable per Default, Website and Store view, so you can preload different assets per store.
- The attribute string is written verbatim after the
href, so keep it to valid<link>attributes. Only add attributes you need, since preloading assets that are not used early wastes bandwidth. - Global preloads apply to every page. For a preload that is only relevant to one page or template, register it from that template instead.