My real-time web app makes ajax requests to obtain JSON econded data responses.
Returned data is usually in the form of an array of objects.
As the array has often a lot of elements (an although data sent is gzipped by the server) in order to keep the response size at minimum I'm keeping the keys in the response very short.
For example instead of using description: I use d:, instead of using width: I use w: and so on...
Doing so reduces the size of the response but, on the client side, very-short non human-readabe keys makes the JavaScript code (that access the object) less readable.
The only solution seem to reparse the response and rebuild the object with pretty keys or replace them in the original object received. But this may hurt the JavaScript code performance resulting in more delay...
Exists a better solution?
EDIT:
As Björn Roberg suggested in his comment I've 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
So as the response is compressed by the server the difference is really minimal.
Still, pretty response require the server to compress 450 KB of data, while short response just 240 KB.
Does this impact server performance (or is there a way to measure it) ?