I have a Java web service that returns a large amount of data. Is there a standard way to stream a response rather than trying to return a huge chunk of data at once?
This problem is analogous to the older problem with bringing back large RSS feeds. You can do it by parameterizing the request: http://host/myservice?start=0&count=100
, or by including next/prev urls in the response itself.
The latter approach has a lot of advantages. I'll search for a link that describes it and post it here if I find one.
I would look into a comet like approach:
From WIKI:
Comet is a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it.
Basically, rather than sending the large data all at once, allow your web server to push data at its own pace and according to your needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With