Forums/Layer Development Platform/Feature Requests

PlannedDoneNot planned

Use compress or gzip transfer encoding to improve network performance

Vsevolod Novikov
suggested this on May 26, 2011 01:06

The json result returning from the server may have a big size. F.e. 1.5km radius and all filters enabled on our Doroga TV layer lead to more than 1Mb result. It may degrade performance of the server. To reduce size of the result we can use transfer encoding negotiation as described in the HTTP 1.1. This kind of negotiation is supported by most of browsers, as well as server software. For example, to add support for such negotiation to the PHP application server, the only one line of code is required at the top of the individual script, or one line of the configuration file for the whole server instead. The negotiation allows to use gzip or compress transfer encoding instead of identity encoding when the both, client and server, support it.

In order to use this feature, the client should tell to the server that it supports gzip and/or deflate transfer encoding. It passes 'Accept-Encoding' header to the server where allowed encodings are listed. If the server, on the other hand, supports this encoding, it uses it and passes appropriate 'Transfer-Encoding' header back in the response.

Therefore, to allow Service Provide to use compressed or gzip encoding, the Layar GetPOI request should contain compressed and/or gzip in the Accept-Encoding header. If Service Provider makes a decision to use compressed or gzip encoding, it provides appropriate functionality to the server.

 

Comments latest first

User photo
Vsevolod Novikov
Hi, Really such a big response was caused by a large number of POIs. Now the max number of POIs is restricted accordingly to explanations in the wiki. But anyway, compression may significantly decrease network traffic and help to decrease network lattency in case of slow networks such as GPRRS.
October 10, 2011 18:45
User photo
xuan
staff

Hello Novikov,

Sorry for this very late reply. We were discussing this request and wondering when the JSON response is sometimes more than 1mb. Does it include the 3d models and images ?

Thanks!

Xuan

October 10, 2011 16:19