I am working on a project, where I want to expose an API which will read a large file send that in response.
Since file can be large in size, it is better to send the file in chunks, so not much memory pressure on system.
I evaluated 2 options : chunked transfer (https://en.m.wikipedia.org/wiki/Chunked_transfer_encoding) which is supported by HTTP-1.1, and a server side streaming by grpc.
In grpc approach, client request through a rpc, while server will stream bytes over grpc channel and close the same once done.
My ecosystem can support both, and client also supports grpc.
Can you please suggest which option is better, what are pros and cons of both approaches.