With the wrapper and universal gateway in place, we can now support large responses in the following way:
- The wrapper detects that the response size exceeds a certain limit
- The wrapper stores the response in an S3 bucket or equivalent storage – ideally in a manner that does not require additional dependencies that need to be packaged or credentials that need to be configured
- The wrapper returns a 307 status with
Location pointing to the stored response body
- The gateway intercepts the 307 status,
RESTARTs and delivers the body from the Location
- The wrapper or some asynchrone job cleans up the response body storage
The response cleanup could also be done by the wrapper in the next request.
With the wrapper and universal gateway in place, we can now support large responses in the following way:
Locationpointing to the stored response bodyRESTARTs and delivers the body from theLocationThe response cleanup could also be done by the wrapper in the next request.