We are using the Section Rendering API to dynamically update images when a variant is selected. However, we’ve noticed that the image URLs returned by the Section Rendering API differ from those generated during the initial page load. This inconsistency causes the images to briefly flash and reload, even when the image itself remains unchanged.
Expected Behavior
The image URLs returned by the Section Rendering API should be identical to those generated during the initial page load, especially when the same Liquid code is used. This would prevent unnecessary image reloads.
This discrepancy causes unnecessary image reloads, leading to a flickering effect that negatively impacts performance and user experience. For consistency and better user experience, the URLs returned by the Section Rendering API should match those generated during the initial render.
Context
We are using the Section Rendering API to dynamically update images when a variant is selected. However, we’ve noticed that the image URLs returned by the Section Rendering API differ from those generated during the initial page load. This inconsistency causes the images to briefly flash and reload, even when the image itself remains unchanged.
Expected Behavior
The image URLs returned by the Section Rendering API should be identical to those generated during the initial page load, especially when the same Liquid code is used. This would prevent unnecessary image reloads.
Example
The following Liquid code in a section file:
Results in the following URL on initial page render:
But the Section Rendering API returns the following URL:
Impact
This discrepancy causes unnecessary image reloads, leading to a flickering effect that negatively impacts performance and user experience. For consistency and better user experience, the URLs returned by the Section Rendering API should match those generated during the initial render.