The Situation
My team is creating an API that receives a large structured text file (100MB - 1TB, 1GB expected) and modifies each row and returns the resulting file. We can process the file as fast as it is transmitted, so would like to avoid caching the file on our servers. We favor ease-of-use for our clients over our own resource use, so this is not a hard requirement.
Some Options
HTTP/1.1 implicitly requires that the full request be processed before the response is sent (except in the case of errors) and bad things can happen, especially with proxies, if you try to get around this. So we were going to bite the bullet and store the request or response and use another resource in our organization for uploading large files for processing.
HTTP/2 explicitly allows you to send before the request has finished and requires that the client read what you send and HTTP/2 is already supported in all major browsers.
So, I see a few potential apis (all POST):
HTTP1.x: upload/download - there is already some infrastructure for this
/transformed_file_id/ --> returns id for the uploaded file
/transformed_file/{id} --> returns the transformed data
HTTP1.x: single request
/transformed_file/ --> returns the transformed version of the file - stores stuff under-the-hood
HTTP2: single request
/transformed_file/ --> returns the transformed version of the file - starts sending response as soon as it receives the first couple of K.
The Question(s)
Though I wouldn't shy away from it for browser content, is it wise to use HTTP/2 for a service in order to access this feature?
Or is all this a bad idea and clients should be forced to upload smaller parts of the file at a time (and we'll need to write a front-end to allow this on a browser-interface - which could be quite tough).