We have identified a reproducible server-side rendering issue in Horizon 4.1.5 when using collection_images for a large navigation menu.
Setup
- Horizon 4.1.5
- Menu has 524 collection links across 3 levels
- All linked collections have a
featured_image - Header menu setting:
menu_style: collection_images
Result
With the standard Horizon code:
/ -> HTTP 500 after ~10.3–10.4 seconds
Changing the menu style to text immediately resolves the issue.
We isolated the bottleneck to snippets/link-featured-image.liquid.
Resolving:
{% assign debug_id = link.object.id %}
works normally.
Resolving:
{% assign debug_image = link.object.featured_image %}
across the large menu causes the same ~10 second timeout.
We also verified that our link-featured-image.liquid was byte-for-byte identical to Shopify’s official Horizon source.
Workaround
We changed the collection-link branch so featured images are only resolved for navigation links that have child links:
{% if link.type == 'collection_link' and link.links.size > 0 %}
{% if link.object.featured_image %}
{{
link.object.featured_image
| image_url: width: 800
| image_tag: loading: 'lazy', class: class, sizes: image_sizes
}}
{% endif %}
With this change:
/ -> HTTP 200 in ~1.7 seconds
We initially attempted to limit this only in mega-menu-list.liquid, but the issue persisted because link-featured-image is also rendered multiple times by header-drawer.liquid.
This appears to be a scalability/performance issue in Horizon’s server-side rendering of collection images for large navigation structures.
It would be useful if the Horizon team could investigate whether image resolution for menu leaf nodes can be deferred, limited, or otherwise optimized.