TransWikia.com

How to cache a product collection in Magento 2?

Magento Asked on October 2, 2021

Currently i load a product collection under certain categories, for example:

$collection->addCategoriesFilter(array('in' => array('2','4')));
$collection
            ->addMinimalPrice()
            ->addFinalPrice();
        $collection->addFieldToFilter('e.attribute_set_id', $attributeSetId);
        $collection->getSelect()->where('e.attribute_set_id = "'.$attributeSetId.'" AND final_price > 0');

the problem with this collection, that it will query like 3000++ product data, can i cache this collection ?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP