Concurrent users and large collections

Highlighted
Tourist
27 0 2

I've got a collection of roughly 12,000 skus(includes variants)/2,000 products.  The variability of its load time is a bit all over the place sometimes testing at 1 second all the way up to 10 seconds.  Rendering is always quick as images have been optimized, JS/CSS has been concatenated and minified, and products per page has been limited to 9. The variablity comes from pre-render where what I assume is liquid code looping through the collection for tag values, and product details.

My questions are:

1) Does this content get cached such that concurrent users are accessing a cached version of the collection content?

2) Is there a way to view "long queries" or slow processes to better tune liquid code for page population and/or remove tools, like certain sidebar facets/filters, because their value is far outweighed by the impact on page speed?

3) When it comes to memory allotment for liquid code how does Shopify handle concurrent users? Is the memory released in a way that allows queued users to access the page without compounding memory usage, or is memory capped and sessions timed out as needed? 

4) Is there a optimal way to loop through collections for tag filter building based on JSON/3rd party app? Is there a way to use native Shopify tools to optimize collection looping?

Relavent details:

1) On a Shopify Plus account

2) Out of the sandbox Turbo theme (using toned down speed optimization)

3) Please note mention of front-end optimizations not being the focus of this discussion

0 Likes
Shopify Expert
9981 85 1492

Not a lot of context to go on here but here's my two cents:

  1. Yes, until you do something to invalidate that cache (like change a product in the collection)
  2. Disable the cache using the querystring ?cache=false. You'd also want to run in private browsing mode to remove any cookies. Being logged into the Admin would generally let you see the cacheless version in any case.
  3. The cached content is served as needed - until it expires or has been invalidated. Amount of users doesn't matter since it's cached.
  4. Yes - depending on what you're doing. Bottom line with loops - avoid nested loops. Also avoid many loops that also loop over variant metafields. You might find some JavaScript options are better suited to your needs - hard to say with context on what you're doing and the code in place. You can make things slower with poorly considered Liquid so that's a good place to dig into.

Chat to your MSM. They've got access to the FED (front end design) team in which some of the things you're talking about here relate to.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes