Preloaded image version is different

Kalipsso
New Member
2 0 0

Hi there.

I am preloading the product tag for speed improvement and I am using <picture> tag to load the product images.

The problem i have is that the preloaded image has a different version than the product image on the page:

preloaded image: _508x508.jpg?v=1612807210

image on the page: _508x508.jpg?v=1612807211

The code i am using for preloading is this:

<link rel="preload" as="image" href="{{ product.featured_image.src | img_url:'400x400' }}" media="(max-width: 767.98px)">

And the code inside product.liquid is this:

<picture>
<source media="(max-width: 767.98px)" srcset="{{ product.featured_image.src | img_url:'400x400' }}">
<img src="(min-width: 300px)" srcset="{{ product.featured_image.src | img_url:'400x400' }}"
alt="{{ image.alt | escape }}">
</picture>

 Can anyone explain why this happens?

Replies 0 (0)