You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/11/27 07:17:15 UTC

[GitHub] [servicecomb-java-chassis] yuzhouzhouba commented on issue #2072: 您好,在传递大文件的时候,遇到的网络延时问题

yuzhouzhouba commented on issue #2072:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2072#issuecomment-734685132


   
   我理解应该是每次读一点(1M),然后就返回,所以第一个就读了1M就应该返回,那么就应该很快
   ================================
   demo如何准备那种带文件的? 其实我的代码就是这样
   
   Resource resource = new InputStreamResource(ret.getObjectContent()); // 这个就是一个比较大的文件流
   
    return ResponseEntity.ok()
                       .contentType(org.springframework.http.MediaType.parseMediaType(contentType))
                       .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + ret.getObjectKey() + "\"")
                       .body(resource);
   
   当调用这个的时候,我期待是立马返回,但是实际了隔了比较久的时间才返回。(用浏览器或者postman都有这种问题)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org