Speed up Rails API to upload/load files using active storage

I have an app build on ionic as front end and rails as back end, I use aws s3 bucket for file uploading and digital ocean for production. Now the files uploading/loading takes so much time as for instance if uploading a file the file is first sent from ionic to rails API, rails API send the file to digital ocean and digital ocean send to aws s3, and this process is reversed to get the response, even for loading files it takes much time. What can I do to speed up my app.

You can upload files straight to s3 from the browser with a presigned post ( https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/Presigner.html )

Fred