@ivymasterman The problem is, you may be trying to stream the response from your server, but you’re still trying to download the file in its entirety and read it into memory before sending a single byte to your end user, hence the memory issues.
Instead, you should be both stream-downloading the file from the third party so that you’re reading it in parts and outputting those parts back to the user so you’re not trying to stuff the entire file into memory at any one point.
Or just stream the file directly from the third party instead of doing this weird hop from their server, to your server, to the end user. You’re just wasting your bandwidth acting as an intermediary for no benefit.