DAM integration new major version, performance improvements and Library Picker folder selection
As you might already have seen we have decided to delist the EPiServer.CMS.WelcomeIntegration version 1.4.0 where we introduced Graph support. Unfortunately a return type was changed that we didn’t catch which means that it became a breaking change. We have decided to delist 1.4.0 and release the performance improvements we have been working on as a new major. We apologize for any inconvenience this has caused and suggest that you either downgrade to 1.3.9 and rely on the CMP API instead of Graph, or upgrade to 2.0.0 instead. We recommend to upgrade to 2.0.0 for the best performance.
Performance
The integration between CMS and CMP uses a combination of the CMP Library Picker, in which the editor selects the asset to reference and, either the CMP´s REST API, or indexed assets in Graph. The API or Graph is used to pull metadata regarding the assets such as sizing or alt texts. The integration with REST API has been around for quite some time and the Graph integration was released in the previous version, 1.4.0, and we described how to configure it in this blog post by Bartosz Sekula.
We are now releasing a change in how metadata is cached in the CMS for assets referenced from CMP DAM. Moving forward from version 2.0.0 the cache will move to the database and stored permanently. This removes the need for any page request that contain CMP DAM assets to perform outbound network requests to retrieve that metadata when cache has expired.
The metadata will be fetched for Image assets from CMP when a content that contains references to those images is published. So metadata will be available once the page starts to receive traffic. Please note that fetching the metadata is handled in the background to not block the editor from interacting with the UI. If the images are already referenced by other pages or block then the already existing metadata will be used.
Should for some reason the metadata not have been populated then the image will still render but with the public URL which was stored the first time the asset was referenced, instead of the latest URL provided by CMP through the metadata.
Renditions of Images is a bit different and a topic to which we will return. Currently the renditions for an image asset will render without alt-text. As already stated, we are working on resolving that. The HtmlHelper and TagHelper as well as DamImageAssetViewComponent will still render the correct rendition.
Example of using HtmlHelper
@model PageViewModel<StandardPage>
@using EPiServer.Cms.WelcomeIntegration.UI.Helpers
@await Html.RenderTagWithMetadata(p => p.CurrentPage.Image)
Example of using TagHelper
@model PageViewModel<StandardPage>
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<dam-asset content-reference="@Model.CurrentPage.Image" />
Maintaining asset metadata
Since the metadata for Images now have moved to the database, how does it get updated? A new scheduled job has been created which will, on schedule, pull metadata from CMP DAM for all assets and update in CMS. This job can be executed manually should the need arise to sync metadata between CMP and CMS.
Metrics from testing scenarios indicate big performance improvements when serving content with DAM assets to visitors.
Asset Library folder selection
CMP has the possibility to organize content in folder structures and it is now possible configure either globally or by type which folder to open in the CMP Library Picker. Configuration is done at startup or appSettings as usual.
.AddDAMUi(o => {
o.Enabled = true;
o.GlobalRootFolderGuid = "a7fd6357c13d49829715f38fe8114c40";
o.RootFolderForTypes = new Dictionary<string, IEnumerable<Type>>
{
{ "57523add60d04e328d7fc1e02c05ed40", new Type[] { typeof(DAMImageAsset) } },
{ "7bce1de28e66411590ac32896eff2ce1", new Type[] { typeof(DAMVideoAsset) } },
{ "72b89ab1b83041acaab861a035db7e7b", new Type[] { typeof(DAMAsset) } }
};
});
Comments