可能的重复: 非常大的HTTP请求与许多小请求
我需要一个2D数组(如Json)从服务器发送到客户端。它将是大约400X400大小,每个条目大约4个字符的文本。
I need a 2D array(as Json) to be sent from server to client. It would be around 400X400 in size with each entry around 4 characters of text. So that makes it around 640KB of data.
以下哪种极端方法更好?
Which of the following extreme approaches is better ?
$ b我相信最佳方法会在中间。有谁能给我一个想法什么可能是这个数据的最佳单个请求大小。
I believe optimal approach would be somewhere in middle. Could anyone give me an idea what might be the optimal single request size for this data.
感谢,
推荐答案提出要求时,处理一些开销(如DNS请求,打开连接并关闭它)。
When making a request you always have to deal with some overhead (like DNS request, opening connection and closing it). So it might be wiser to have 1 big request.
当你有一个大的请求时,你可能会遇到更好的gzip / deflate压缩。
Also you might experience better gzip/deflate compression when having 1 big request.
更多推荐
非常大的HTTP请求与许多小请求
发布评论