Preload Groups
Overview
Section titled “Overview”Preload Groups allow you to organize placements into logical groups that should be loaded together. This is useful for coordinating the loading of related placements.
How It Works
Section titled “How It Works”When placements are assigned to the same preload group, Htag ensures that they are loaded together. Note that their rendering is still async and not binded together, preload groups only affect the loading process.
Groups are determined by string equality - placements with identical preload group strings will be treated as part of the same group. This means that "header" and "header" are the same group, but "header" and "Header" are different groups (case-sensitive).
Group Naming Rules
Section titled “Group Naming Rules”Preload groups follow these specific rules:
- Any string value: The preload group can be any string value you choose
- String equality: Groups are considered the same if and only if their string values are exactly equal
- Case sensitive:
"sidebar"and"Sidebar"are treated as different groups - Empty string behavior: An empty string (
"") is treated as no group at all, meaning placements with empty preload groups will not be grouped together
Configuration
Section titled “Configuration”Preload groups are configured at the placement level using the preloadGroup parameter when defining a placement with the definePlacement method.
Placements with the same preload group value will be treated as part of the same group. If preload groups are not specified, placements will be treated as separate groups.
Related Concepts
Section titled “Related Concepts”- Placements: Learn more about placement configuration
- Lazy Loading: Learn about delayed loading of placements