A user is comparing two code implementations for displaying a second image in Shopify Dawn theme’s image-banner.liquid file, seeking advice on which performs better for SEO and PageSpeed Insights scores.
Version 1 (User’s Code):
Uses Shopify’s image_tag filter
Simpler implementation with basic image rendering
Includes fetchpriority attribute
Version 2 (ChatGPT-Generated):
Implements <picture> element with multiple format sources
Serves modern image formats (AVIF, WebP) with JPG fallback
Includes additional attributes: loading=“eager”, fetchpriority=“high”, decoding=“async”
Explicitly defines alt text handling
Key Technical Difference:
Version 2 provides progressive image format support, which typically improves load times and PageSpeed scores by serving optimized formats to compatible browsers.
A responder provided an alternative: complete custom banner section code with responsive desktop/mobile image handling, but this doesn’t directly address the original comparison question.
Status: The question about which version is superior for SEO/performance remains unanswered by the community.
Summarized with AI on October 24.
AI used: claude-sonnet-4-5-20250929.
I have to version of code for image2 in image-banner.liquid for Dawn theme. The first one is my version and the second one is generated by Chatgpt, which one is better for SEO and improve score in Pagespeed insights? Thanks!
Version 1:
{%- if section.settings.image_2 != blank -%}
<div class="banner__media media{% if section.settings.image != blank %} banner__media-half{% endif %}{% if section.settings.image_behavior != 'none' %} animate--{{ section.settings.image_behavior }}{% endif %}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--fade-in{% endif %}">
To add the custom banner, create a new section file in your theme’s code editor named custom-image-banner.liquid. Delete any default code in that new file and paste the complete code block below. Once saved, you can add and customize your new “Image Banner” section from the theme editor.