Moving substantial data.
WHAT BREAKS WITH LARGE BODIES
Memory consumed loading them Timeouts Gateway and proxy limits Retries repeating the whole transfer
WHAT TO SET
A maximum request size, enforced early.
WHY EARLY
Reading an enormous body before rejecting it is the problem itself.
WHAT TO DO FOR FILE UPLOADS
Issue a direct upload address, and let the client upload to storage directly.
WHY THAT IS BETTER
Your service never handles the bytes.
HOW IT USUALLY WORKS
The client requests permission, receives a time-limited address, uploads, then tells you.
WHAT TO VERIFY AFTERWARDS
That the file arrived, and matches what was declared.
WHAT TO CHECK ABOUT UPLOADED FILES
Size Type, by content rather than by name Content, where it will be processed
WHY TYPE BY CONTENT
Extensions are trivially falsified.
WHAT TO DO FOR LARGE DOWNLOADS
Stream, rather than building the whole response in memory.
WHAT TO PROVIDE FOR LARGE EXPORTS
An asynchronous job producing a file, with notification.
WHY
A synchronous export of a large dataset will time out.
WHAT TO SUPPORT WHERE CONNECTIONS ARE POOR
Resumable transfers.
WHY THAT MATTERS LOCALLY
A dropped connection otherwise means starting again.