My real-time web application makes ajax requests to get responses to JSON requests.
The returned data is usually an array of objects.
Since the lot element is often present in the array (although the data is transmitted by the gzipped server) in order to keep the response size to a minimum, I keep the keys in the response very short.
For example, instead of using the description: I use d: instead of using width:. I use w: etc.
This reduces the size of the response, but on the client side, very short keys that do not contain a person make JavaScript code (which refers to the object) less readable.
The only solution seems to repeat the answer and rebuild the object with cute keys or replace them in the original received object. But this can damage the performance of the JavaScript code, resulting in a longer delay ...
Is there a better solution?
EDIT:
As BjΓΆrn Roberg suggested in his comment, I made a comparison:
pretty-response.json 459,809 bytes short-response.json 245,881 bytes pretty-response.json.zip 28,635 bytes short-response.json.zip 26,388 bytes
Since the response is compressed by the server, the difference is really minimal.
However, a fairly response request requires the server to compress 450 KB of data, and a short response only 240 KB.
Does this affect server performance (or is there a way to measure it)?