On my web app, I have a link which the user can click and download a CSV file containing some information.
When the user clicks on the download link, the app retrieves the records from DynamoDB and saves the results as a file to S3 in an asynchronous manner because it may take around 15seconds for the retrieval and saving to complete.
This would imply that when the user clicks on the download link, the file isn't available immediately on S3 to serve to the user.
In this case, how can I push the file to the user on the frontend as soon as the file has been saved successfully to S3 and ready for download?