Media Library takes around 8-10 seconds to load

Created on 26 May 2025, 11 days ago

Problem/Motivation

The DAM media library takes more than 8 seconds to load and gives a very bad UI for the end user. Making users wait for longer time.

Steps to reproduce

Setup Acquia DAM and add a new Media reference Field in Article content type and select media types 1 of the existing Acquia DAM types and save it.
Now add a new article and add the newly created media and see the media library takes longer time to load.

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇮🇳India deepakkm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @deepakkm
  • 🇮🇳India deepakkm

    Adding screenshot for single and multiple asset. I do see it just gives around 7-8 assets in result but takes around 2 sec which is still higher in number

  • First commit to issue fork.
  • 🇮🇳India rajeshreeputra Pune

    Most probably issue introduced because of the AvailabilityPublishingStatusCompare.php.

    The AvailabilityPublishingStatusCompare field is calling $this->assetUpdateChecker->checkAssets($values->_entity) for every single row in the media library view during the render() method.

    The Problem

    N+1 Performance Issue:

    • Media library loads: 12 assets per page
    • Each asset triggers: checkAssets() call in render()
    • Result: 12 individual API calls to Acquia DAM

    Why this happens

    • The render() method is called for every row when the view is displayed.

    Solution

    • Remove the "Availability/Publishing status" field from Media library.
Production build 0.71.5 2024