Magento 2 Product Preloader

View on GitHub

Batch product data preloader for Magento 2 that eliminates repetitive per-product N+1 queries under low cache-hit scenarios.

Overview

In default Magento 2, rendering a category page, search result, or custom product widget with a cold cache triggers dozens of separate SQL queries per product, loading gallery images, child options, inventory, and pricing one SKU at a time.

EcomDev/magento2-product-preloader replaces those N+1 database round-trips with a clean, extensible batch preloading pipeline that fetches required catalog data for an entire product collection upfront.

Installation

composer require ecomdev/magento2-product-preloader
bin/magento module:enable EcomDev_ProductPreloader
bin/magento setup:upgrade

Example Implementation

See EcomDev/example-preloading-configurable-product for a complete working example showing how to preload configurable product options and swatches across category listings without touching core templates.

Where It Shines

  • Large multi-store catalogs with frequent cache invalidation or personalized pricing.
  • High-SKU configurable products where default swatch and child-product loading dominates TTFB.
  • Headless / GraphQL & Hyvä storefronts that need predictable, low-query catalog responses.

More in Performance Tools

View all Performance Tools →