How should I send/receive a large search results array (NodeJS, AngularJS) -


i have app uses nodejs back-end , angularjs front-end. when send search query using angular's $http back-end, back-end returns array of search results.

i've discovered testing app on remote server slow internet connection can bottleneck search. in particular, angular can't use search results until of them sent. okay small number of results (< 1,000) i'd improve when there many search results.

is there strategy can use angular can display each search result arrives , not wait entire array sent?

  1. i use websockets send results 1 @ time (don't know why that, check no. 2).

  2. i paginate result on backend reasonable amount (50 might trick depending on loaded relationships) , implement infinite scroll fetches next items asynchronously (something along lines of https://material.angularjs.org/latest/demo/virtualrepeat).


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -