To implement ImageEngine’s image optimization for Sitecore, you will first need to sign up for an ImageEngine account, if you do not already have one. During the signup process, you’ll be asked for the website domain where you intend to use ImageEngine and origin URL for the majority of the images. For more information about signing up, please refer to this article: Getting Started: Signup.
Once signed up, you will be issued a unique delivery address following this pattern: “aabbcc.cdn.imgeng.in.” Custom delivery addresses may also be made after the initial signup process is complete. For more information, see our article here: https://imageengine.io/docs/implementation/domain-name.
Take note of your delivery address, as we will be needing it in the next step.
Add ImageEngine references to Sitecore
Sitecore's CDN properties are defined in the Sitecore.config file. Modifying these settings will allow you to pass images to ImageEngine instead of serving from your current origin:
<setting name="Media.MediaLinkServerUrl" value="aabbcc.cdn.imgeng.in."/>
<setting name="Media.MediaLinkPrefix" value="-/media/images" />
<setting name="Media.AlwaysIncludeServerUrl" value="true" />
<setting name="MediaResponse.Cacheability" value="public" />
Descriptions of the settings to be modified:
- Media.MediaLinkServerUrl
Set the value to the URL of your ImageEngine Delivery Address that you obtained when signing up or manually created later. - Media.MediaLinkPrefix
Used to specify the media library link URL. With ImageEngine we need to specify the directory containing your image content. If you require ImageEngine to deliver non-image content, we can either provide you with a secondary domain or we can make a modification to our edge caching rules to enable mixed content. - Media.AlwaysIncludeServerUrl
Set the value to true, to always include the CDN URL when obtaining a media item URL. Otherwise, the media URL will be generated without the ImageEngine Delivery Address you have specified and the request will not be served by ImageEngine. - MediaResponse.Cacheability
Set the value to public, to let ImageEngine cache the response. Otherwise, instead of caching the response, ImageEngine will need to ask the Sitecore server for the response every time you request a media item. This value is set as a cacheability response header.
Sitecore reference page for the above parameters: https://doc.sitecore.com/xp/en/developers/91/sitecore-experience-manager/sitecore-media-library-cdn-related-configuration-reference.html
For complete documentation for Enabling CDN for Sitecore, see their documentation here: https://doc.sitecore.com/xp/en/developers/91/sitecore-experience-manager/sitecore-media-library-cdn-overview.html
Comments
0 comments
Please sign in to leave a comment.