Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Improve category list page performance
Adam Bogdałe045d26f3bf1
diff --git a/saleor/product/views.py b/saleor/product/views.pyindex 2abd3eef51..f9066ad257 100644--- a/saleor/product/views.py+++ b/saleor/product/views.py@@ -44,7 +44,7 @@ def category_index(request, path, category_id):return redirect('product:category', permanent=True, path=actual_path,category_id=category_id)products = category.products.get_available_products().select_subclasses()- products = products.prefetch_related('images')+ products = products.prefetch_related('images', 'variants', 'variants__stock')return TemplateResponse(request, 'category/index.html',{'products': products, 'category': category})