I developed a rest service with apache CXF and Spring mvc with MySQL as back end.All the images,audio files are stored in the database(I know its a bad idea) but Its my thesis. When I was testing the response time(RESTclient plugin in fire fox! ) and the payload content being transferred for an individual request. Strange results popped out. Time taken for the XML payload was much less both in time(ms) and content length(bytes) compared to JSON. The payload contains image and audio files encoded with base64 and the compressed with GZIP in the action classes. So, can I come to a conclusion that JSON has more overheads than XML. Please shed your thoughts and experiences.
Share
Yes, GZIP works great on compressing textual data. When image and audio are compressed after retrieving from db, the size of the content did not vary much. So, encoding the content and then compressing it is better if you are transferring them in byte[ ].