One Image, Different Screens: Designing Smarter Image Delivery with SitecoreAI
A Solution Architect's perspective on image parameters, responsive behavior, and controlling how media is delivered.
A Small Image Requirement with a Bigger Impact
Imagine a content author uploads a high-resolution image for a new marketing campaign.
The same asset needs to appear in three places.
On the homepage, it is a large promotional banner.
On an insights page, it appears inside a smaller card.
On mobile, it occupies a narrower area.
The content team would prefer to manage one image rather than upload multiple copies.
From an architecture perspective, that is a reasonable requirement.
But the frontend should not necessarily deliver the original file at the same size everywhere.
This is where Content SDK image parameters become useful.
Understanding Image Parameters
SitecoreAI Content SDK supports image parameters through the imageParams property of its image components.
These parameters influence how media URLs are generated and how images are retrieved.
Some control image dimensions.
Others relate to media context, language, version, or caching.
Common parameters include:
| Parameter | Purpose |
|---|---|
w | Requested image width |
h | Requested image height |
mw | Maximum image width |
mh | Maximum image height |
sc | Image scaling factor |
iar | Ignore the original aspect ratio |
as | Allow upscaling |
la | Image language |
vs | Image version |
thn | Request thumbnail behavior |
The important point is that these are media delivery parameters, not simply CSS properties.
They influence the image URL and the media response.
A Practical Example
Suppose we have a reusable promotional component.
We can specify maximum media dimensions using Content SDK's Image component.
<Image
field={props.fields.image}
imageParams={{
mw: 600,
mh: 400
}}
className="promo-image"
/>This requests an image constrained by the provided media dimensions.
However, the HTML layout still requires appropriate styling and sizing.
The image delivery configuration and visual presentation should work together.
Responsive Images Need Additional Planning
For responsive delivery, Content SDK's standard Image component supports srcSet and sizes.
For example:
<Image
field={props.fields.image}
srcSet={[
{ mw: 300 },
{ mw: 600 }
]}
sizes="(min-width: 960px) 600px, 300px"
/>This allows the browser to select an appropriate source based on its rendering requirements.
For Next.js applications, the NextImage component offers another approach through Next.js image optimization.
One detail worth remembering is that NextImage does not support the srcSet property in the same way as the standard Content SDK Image component.
What Would I Consider as a Solution Architect?
I would avoid allowing every component to define arbitrary image transformation rules.
Instead, I would establish conventions for commonly used image roles.
A hero banner, product thumbnail, and article card do not have identical requirements.
Image transformation should reflect those differences.
I would also review the implications of upscaling, aspect-ratio changes, caching behavior, and unnecessary image variants.
For example, allowing images to stretch beyond their original dimensions may not improve visual quality.
Similarly, generating too many variants without a clear purpose can complicate media delivery and caching.
Responsive image delivery is not only about making images fit different screen sizes.
It involves balancing visual quality, network usage, component flexibility, and content management.
SitecoreAI Content SDK provides useful parameters for managing these requirements.
But the architectural value comes from applying them consistently.
A well-designed media strategy allows content authors to reuse assets while ensuring that
No comments:
Post a Comment