java - How to divide large Http Response -


i have spring boot restful service api. consumers other applications. 1 of app's controller returns 1 000 000 strings on request.

what best practice of splitting such responses in spring applications?

update: figured out response needed developer's needs , executed once. it's better create script operation. answers.

here example use multi part request in spring boot: https://murygin.wordpress.com/2014/10/13/rest-web-service-file-uploads-spring-boot/

however, prefer think problem architectural point of view.why should rest returns such huge response?and necessary returns results? there few factors might me give better answer. kind of situation when there trade off.

1)the basic question is, can't provide additional(they don't have mandatory, can optional parameters) reduce amount of returned results? 2)how frequent data change?if don't change pretty often(let's once day) can introduce sort of paging mechanism return segment of result. side , can introduce caching mechanism between business logic layer/data base , rest client. 3)if data changing frequently(like providing list of flight prices), can introduce caching layer per client id. can cache results side , send client divided several requests. of course have add time stamp , expiry date each cached request or otherwise face memory issues. 4) leads question, pain comes from? application clients complain not being able handle amount of data receive? or complain response time of service?or having performance issue on server side?


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -