I currently have about 420 products and over 100 of categories to choose from for each products, showing the list of categories and filtering it, works fine, and performance is not too bad when it's also cached.

What I'm trying to do now is show the total number of products for each filter, but it has to update when I select a filter,(on a side note: my filter is currently being done through ajax).

My issue is that, with all the number of products and filters, when I get all the total number products for that filter, it gets very query heavy and slow which is not a good user experience.

What's the best way to do this, performance wise?

  • Do you want to update the number of matching products based on your latest query or based on all products. So for an example the user enters your shop and has 100 products for filter A and 50 products for filter B when the user selects filter A the number of products for filter B should be updated? – Robin Schambach Oct 20 '17 at 8:57
  • I want to update the number of products based on the latest query. – pinksorceress23 Oct 20 '17 at 12:32
  • With 400+ entries and so many different filters I would suggest you to build your search with angular. This is a javascript framework and it seems your desire perfectly fits to this since it replaces the calculations from the server to the client and thus increases the speed and it makes everything easier for you. I faced the same problem some time ago and was able to make my request 400% faster because I didn't need to render the templates anymore and I build my own database query instead of using the one from the elementCriteriaModel. Unfortunately I don't have another suggestion – Robin Schambach Oct 20 '17 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.