November Happy Hour will be moved to Thursday December 5th.

Robert Svallin
Nov 29, 2024
  241
(1 votes)

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.

The scheduled job for maintaining CMP DAM asset metadata in 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) } }
    };
});
Nov 29, 2024

Comments

Mike Malloy
Mike Malloy Dec 2, 2024 08:22 PM

You should add an Admin page to Settings that allows a single asset to be updated. Otherwise the user has to wait for the job to finish.

Robert Svallin
Robert Svallin Dec 2, 2024 09:57 PM

Yes you are correct and we plan on improving this aspect. For the time being, metadata is pulled from CMP when publishing content that references assets in CMP or through the daily job. I dont have an ETA on improvements to the sync just yet, but we are planning for it.

Please login to comment.
Latest blogs
AsyncHelper can be considered harmful

.NET developers have been in the transition to move from synchronous APIs to asynchronous API. That was boosted a lot by await/async keyword of C#...

Quan Mai | Dec 4, 2024 | Syndicated blog

The search for dictionary key

Recently I helped to chase down a ghost (and you might be surprised to know that I, for most part, spend hours to be a ghostbuster, it could be fun...

Quan Mai | Dec 4, 2024 | Syndicated blog

Shared optimizely cart between non-optimizley front end site

E-commerce ecosystems often demand a seamless shopping experience where users can shop across multiple sites using a single cart. Sharing a cart...

PuneetGarg | Dec 3, 2024

CMS Core 12.22.0 delisted from Nuget feed

We have decided to delist version 12.22.0 of the CMS Core packages from our Nuget feed, following the discovery of a bug that affects rendering of...

Magnus Rahl | Dec 3, 2024

Force Login to Optimizely DXP Environments using an Authorization Filter

When working with sites deployed to the Optimizely DXP, you may want to restrict access to the site in a particular environment to only authenticat...

Chris Sharp | Dec 2, 2024 | Syndicated blog

Video Guides: Image Generation Features in Optimizely

The AI Assistant for Optimizely now integrates seamlessly with Recraft AI, providing advanced image generation capabilities directly within your...

Luc Gosso (MVP) | Dec 1, 2024 | Syndicated blog