This article provides a best practice for using the Allow All Products per Page setting, depending on your catalog size, to optimize Magento storefront performance.
Affected products and versions
You can configure Magento to allow shoppers to view all category products on a single page. But if the number of category products significantly exceeds 48 products, it may take a long time for them to render.
The recommendation is to set the Allow All Products per page configuration to No, if you have more than 48 products in any category.
To change this configuration, in the Magento Admin Panel go to Stores > Configuration > Catalog > Catalog > Storefront > Allow All Products per page = No.