I'm building up a filter feature to filter through a lot of products based on its prices, brands, rating, and so on. Multiple check boxes for these rules above. I'm just wondering what would be the best practices to do this? I went through couple posts but still unsure which approach I should target.
Request the data from all products and then filter through them from the frontend? (ie. custom pipe and transform the data) Called once to the server and client side will handle the rest.
Base on the filter rules, send the request to get specific data back by query through the database. This approach would call the server every time the new rules in the filter changed.
So, which is better for performance or just use both?
Thanks!
For filter, it turned out that the better option would be requesting all products and then filter through them from the frontend.