Angularjs get request for a huge json file

后端 未结 2 456
没有蜡笔的小新
没有蜡笔的小新 2021-01-18 06:17

I need to display some data from a database to the user. The data is in a json file and has a pretty huge size. The size of json file is roughly around 15MB. I created a ser

2条回答
  •  轮回少年
    2021-01-18 06:50

    Make your backend deliver the file in chunks, so that your angular frontend can retrieve part of it at a time.

    Something like:

    /backend/getentries?skip=500&count=100

    The have your frontend repeatedly call the backend while counting up skip and append the results you are getting back to whatever you already have in the frontend.

提交回复
热议问题