Answer the question
In order to leave comments, you need to log in
What is the fastest way to transfer data over http?
There is some data array in json.
Weighs for example 1mb.
It must be passed to the client from the server by the client's ajax request.
How will it be optimal and on what it may depend?
1. One ajax request - full response in 1mb
2. 4 parallel ajax requests and responses from the server in parts
ps gzip compression is already enabled.
Answer the question
In order to leave comments, you need to log in
It seems to me that it is quite possible to break the task into pieces. As an example, not so long ago, we made a choice of a country and a city. The first mistake was to send all pre-generated content to the frontend, resulting in a page weighing several megabytes. We replaced requests for getting a list of countries and cities with Ajax, it turned out better, but not ideal. Since several tens of thousands of cities without filtering hung up the front. And in the end, the decision was very simple. Until the person has selected a country, do not show cities. I chose a country, Ajax went to the server with a request for cities in this country, the request was received, shown at the front. The city has changed - all over again. The cache on the server side of the query results solves many problems with a bang. I think you should find the dependencies and there is no need to dump so much information into the browser
1mb for today's Internet - a penny
with one request, in fact there will be less traffic (headers go 1 time)
with 4 requests, you will have to cut the response on the server and glue it on the client
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question