Maximum size of ajax returned data

前端 未结 2 733
攒了一身酷
攒了一身酷 2021-02-12 10:07

Fellow coders, I have asked this question before but did not get a conclusive answer to it. The question is: how much data can i safely return from and ajax post call before i r

相关标签:
2条回答
  • 2021-02-12 10:21

    I don't think either factor you listed would be an issue. What I would look at are:

    • The amount of time the user is willing to wait for the response. Also, your server-side programming language or web server might impose a limit on the length of any one request.
    • The amount of RAM the client has. Even if there is no variable size limit, eventually the computer will run out of space.

    In these situations, you are almost always better off delivering smaller chunks of the data at a time and allowing the user to load what data they need (either by granulation [showing summaries and letting them drill down], or pagination / search). No one wants to wait 10 minutes for the site to load, and HTTP doesn't really handle large requests all that well.

    0 讨论(0)
  • 2021-02-12 10:32

    See this answer: Javascript maximum size for types?

    In short, unless the browser specified otherwise, variable sizes are not subject to a restriction. As for Ajax: There's no limit, unless defined server-side (such as this one).

    0 讨论(0)
提交回复
热议问题