响应浏览器的最大 json 大小 [英] Maximum json size for response to the browser

查看:44
本文介绍了响应浏览器的最大 json 大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一些用 JavaScript/jquery 准备的自定义控件创建树.

I am creating tree with some custom control prepared with JavaScript/jquery.

为了创建树,我们提供 json 对象作为 java-script 的输入,以遍历并创建树.

For creating the tree we are supplying json object as the input to java-script to iterate through and create the tree.

因为数据量可能高达 25K 节点.在基本负载测试期间,我们发现浏览器会因为这样的音量而崩溃.

Since the volume of data may go up-to 25K nodes. during a basic load test we identified that the browser will be crashed for such volume.

替代解决方案只是加载第一级节点,然后通过 AJAX 请求按需加载.第一级的容量可以变化到 500 - 1K 节点.

The alternate solution is just load first level of the nodes and rest load on demand via AJAX request. the volume of first level can vary up-to 500 - 1K nodes.

作为来自服务器的响应,json 应该具有的最大大小是多少.在浏览器上处理如此大量数据的最佳方法是什么.

What is the max size a json should have as a response from the server. What could be the best approach to process such volume of data on browser.

推荐答案

http 响应没有最大大小限制(或者已经配置了 Int 的最大大小或者浏览器的限制或者服务器的限制).

There is no max size limit of the http response (or the max size of Int or the limit of browser or the limit of server have been configured).

最好的方法是使用 AJAX 加载需要显示的部分数据.

The best approach is use AJAX to load part of data while it need to be shown.

这篇关于响应浏览器的最大 json 大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆