I have a routing file. When a user goes to site.com/page, my route makes a call to an SQL DB and then parses the results and returns them as JSON. Then I use
res.render('route/to/view', {data: result, moredata: resultTwo})
which sends data to the view. The problem is that my data is relatively large and takes forever to send to the view. I am 100% sure this is what is making my page run slowly. When I cut the dataset in half, the it displays much quicker. I am also aware that the actual showing of this data is also a factor, but I am strictly concerned with the speed at which it is passed from the routing to the view.
Is it any more efficient to pass a bunch of small chunks rather than one large chunk? Is the only way around this to do gradual passing of small chunks?
Aucun commentaire:
Enregistrer un commentaire