I've got a rails application that does the next (right now linear) process:

(1) User uploads personal files via HTTP along with a standard upload form on the standard HTML page (2) The file is submitted for an apache server (same server because the one hosting the application) (3) The server uploads the file to remote storage service (refer to this as storage 1) (4) When (3) is performed, the consumer is taken instantly with a other page

As the file has been submitted the consumer sees a progress bar etc.

Now question: - (1) -> (4) takes a significant very long time for big files (because processes (2) and (3) require sometime) and also the browser waits for any server response before moving to (4) (i.e. an answer from server showing the conclusion of (3) have finished).

Can there be in whatever way of accelerating (1) -> (4). I do not mind when the file loads into storage 1 and to the server without anyone's knowledge as the user is permitted to browse other page on the website.

The additional thought is - the server that the file is submitted to (allows refer to it as server 1) could be dissimilar to the hosting server (server 2) if required.

Any ideas appreciated.

The moment the file is submitted towards the server, move them on. Allow the server itself handle the moving the file to "storage 1" using something similar to Postponed Job after which inform the consumer (utilizing a system for example email) the file has become open to be downloaded.