How To Get Data Using Json When Loading Page For The First Time

Hi All,

I have six tables in my db related with user table. Now I need to show all the data at a time when the page loads.

  1. I can render the page and then asynchronously I send some request and fetch the data from the server.

  2. I can pull all the data sequentially from db and then can render the page. which is eventually very bad in performance.

  3. Only pull data of user, use lazy loading and get all in run time.

The problem is that could not getting which one will be better in terms of performance.

In the meanwhile I have seen some sites are sending data to view as json and there it is parsed or some thing like that. But the interesting fact is that they are sending data as json when the page is loading for the first time.

So Please someone help me if anyone know how to serve this purpose of sending and recieving data for the first time when the page is loading. If anyone has some better idea to handle these large data very efficiently, please share.