QUALITY PATCH

ACSD-50858: Banner performance is impacted in the cart/checkout page due to excessive DB queries…

Banner performance is impacted in the cart/checkout page due to excessive DB queries and increased page loading time. Quality patch ACSD-50858 for magento/module-banner applies to Magento Open Source and Adobe Commerce 2.4.4 to 2.4.6-p15.

Categories
Performance, Content
Components
magento/module-banner
Origin
adobe-commerce-support
Since QPT
1.1.31

Issue

Banner performance is impacted in the cart/checkout page due to excessive DB queries and increased page loading time. This was fixed by refactoring the way banners' contents are loaded, which reduced the number of DB queries by 99.99% and the page loading time by ~99%.

Steps to reproduce

1. Log in to Admin and create a simple product. 1. Create a customer, either from Admin or from the frontend, and add a shipping address for it. 1. Move banners.php to the magento_root/pub/ folder. 1. Generate banners using the php pub/banners.php command. It will generate 10,000 simple banners and 1,000 banners with sales rules. 1. Log in to the customer created previously on the frontend. 1. Add the product created previously to the cart. 1. Go to the checkout page (checkout/cart). 1. Monitor the banner/ajax/load request loading time: * Without bin/magento dev:query-log:enable * With bin/magento dev:query-log:enable grep 'magento_banner_content' var/debug/db.log | wc -l

Adobe's page lists 2.4.4 - 2.4.6 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.

Adobe scheduled the permanent fix for 2.4.7.

Install

Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply ACSD-50858. On Cloud, add ACSD-50858 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its ACSD-50858/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.

Patch files and compatible versions

Packages across compatible versions (1): magento/module-banner

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.