I have CloudFront serving my Angular pages and Elastic Beanstalk running a nodejs server that handles the API calls.
One call in particular takes a lot of time. It reads files that are stored in a flat structure and puts them into a file structure then zips them up and returns them to the user. Most of these files are > 100 MB in size so it takes time. I have put CloudFront's Origin Response Timeout at 60 (which it says is the maximum) and the data I am working with will work with that much time but we are only getting started and I know that there will be times later on when 60 seconds is not going to be long enough.
CloudFront does seem to make 3 attempts (the original plus 2 retries) so it would be a total of 3 minutes but when the first retry comes in then the process will not complete. I even put in a hack that checks to see if the process has already been started in subsequent calls but it still hangs the process and ends up returning a 504.
My question is is there a way to have CloudFront wait longer than 60 seconds or is there something that I can periodically return that says I am still working and reset the timeout? Everything that I have tried so far doesn't work.