Log in Sign up
Discussion Shopify

Liquid Error: 'Memory limits exceeded' in collection.liquid loop. How to optimize?

Robert Hosting
Robert Hosting
0 reputation
1 week ago 78 views 3 replies
Working on a project and need some expert opinions:

Question: Liquid Error: 'Memory limits exceeded' in collection.liquid loop. How to optimize?

3 Replies

Sophie Shopper
Sophie Shopper · 1 week ago
Don't use `collection.products` inside a snippet rendered 50 times. Pass the product object explicitly.
Alex Woo
Alex Woo · 1 week ago
You are likely nesting too many `{% for %}` loops. Limit the depth to 50 products.
Alex Woo
Alex Woo · 1 week ago
Use `{% paginate collection.products by 20 %}` to handle the memory load better.

You must be logged in to reply.

Log In to Reply