INTERACT FORUM

Windows => Third Party Plug-ins, Programs, and Skins => Topic started by: PaulSinnema on May 02, 2012, 02:48:52 pm

Title: JSON Webservice
Post by: PaulSinnema on May 02, 2012, 02:48:52 pm
Hi,

I would like make a suugestion. Until now I've been using the Webservice that sends responses in XML form. XML is a protocol with a big overhead. This format is, although flexible, not very efficient. JSON on the other hand offers a much more efficient way of data transfer. With fast networks there is no need to change from XML to JSON but on handheld devices that rely on WLAN connections any reduction would be welcome.

Another possibility could be GZipping the response. This would reduce the XML traffic considerably.

Regards
Paul
Title: Re: JSON Webservice
Post by: Matt on May 02, 2012, 03:06:28 pm
Another possibility could be GZipping the response. This would reduce the XML traffic considerably.

If you add the header "Accept-Encoding: gzip" to your requests, the XML data will be compressed.

Only packets longer than 1024 bytes will get compressed, but of course the response headers will specify the encoding, if any, used.

This was added in 15.0.160 (12/1/2010)
Faster: Servers that power DLNA, WebPlay, Gizmo, etc. will use gzip compression for clients that support it.
Title: Re: JSON Webservice
Post by: PaulSinnema on May 03, 2012, 08:07:52 pm
Hi Matt,

Cool. I request a change to find out it has already been implemented. You guys have done a lot of cool stuff, thanks.

I'll try and implement the GZip thing. A concern I later thought of could be that the processpower of handheld devices could be too limited for a lot of GZip processing. But it's worth a try.

Regards
Paul
Title: Re: JSON Webservice
Post by: PaulSinnema on May 06, 2012, 11:16:36 pm
Hi Matt,

Very cool indeed. Adding the header starts the compression. In the images you can see the compression ratio of two sessions with and without compression. The effect is clear. Compression is up to 50% and you can also see the average size and max size of packages shrunk considerably. Now I have to test this on the real thing. I'll let you know how that goes. Thanks again.

Regards
Paul