Hello Shopify team,
Store: https://khalegishop.shop
Tested page: جهاز ذكي يوفر كهرباء بيتك من أول - يوم عرض خاص اليوم فقط – khalij
Theme: Online Store 2.0 (customized). Issue only on mobile – LCP fluctuates from ~4.7s to ~11s across runs on PageSpeed Insights.
What I did:
- Preloaded the featured image with high fetchpriority in theme.liquid.
- Reduced srcset widths and set sizes to (min-width: 750px) 50vw, 100vw.
- Made the first product image eager + fetchpriority=high, others lazy+auto.
- Images are WebP and compressed.
Code snippets:
– theme.liquid (inside ) –
– product-media.liquid –
{% if media.media_type == ‘image’ -%}
{% if forloop.first %}
{% assign loading_type = ‘eager’ %}
{% assign fetch_priority = ‘high’ %}
{% else %}
{% assign loading_type = ‘lazy’ %}
{% assign fetch_priority = ‘auto’ %}
{% endif %}
<img
class=“global-media-settings global-media-settings–no-shadow{% if variant_image %} product__media-item–variant{% endif %}”
loading=“{{ loading_type }}”
fetchpriority=“{{ fetch_priority }}”
decoding=“async”
srcset="
{{ media.preview_image | image_url: width: 550 }} 550w,
{{ media.preview_image | image_url: width: 800 }} 800w,
{{ media.preview_image | image_url: width: 1100 }} 1100w
"
sizes=“(min-width: 750px) 50vw, 100vw”
src=“{{ media.preview_image | image_url: width: 700 }}”
alt=“{{ media.alt | escape }}”
width=“700”
height=“{{ 700 | divided_by: media.preview_image.aspect_ratio | ceil }}”
data-media-id=“{{ media.id }}”
{% endif %}
Question:
- What else in OS 2.0
product-media.liquidor layout could keep LCP > 5s on mobile? - Is there a recommended pattern for reserving space or skeleton for the hero image in product templates to stabilize LCP?
- Any theme-level scripts known to delay LCP we should defer differently?
Thanks!


