So I’ve got a list of objects which is processed in the backend side of my application and is then passed to the front end for displaying purposes. However, I only want to show 4 items from the list at most. My question is- should I clip the list in the back end or should I pass the whole list to the front end and allow it to clip the list?
Thanks.
Of course, on the back-end, to remove unneeded network transmission. You need do it once for all your front-ends.
I don’t think there are practical use-cases when it’s more suitable to do it on front-end, since, even if back-end doesn’t trim and, thus, saves it’s CPU a bit, much more processing is done by backend underlying OS to transmit redundant bytes to clients.