gbfs-validator icon indicating copy to clipboard operation
gbfs-validator copied to clipboard

Response payload size exceeded maximum allowed payload size

Open tdelmas opened this issue 1 year ago • 10 comments

Validation with https://api-public.odpt.org/api/v4/gbfs/hellocycling/gbfs.json :

{ "errorMessage": "Response payload size exceeded maximum allowed payload size (6291556 bytes).", "errorType": "Function.ResponseSizeTooLarge" }

tdelmas avatar Jul 03 '23 14:07 tdelmas

Probably nothing to do :\ https://answers.netlify.com/t/lambda-functions-response-size-too-large/22374/2

PierrickP avatar Jul 03 '23 14:07 PierrickP

As an alternative solution, we can follow the GTFS validator's pattern, create the JSON and HTML reports as separate files and make them available for download. The HTML version can be rendered in the bottom section of the current UI; this will require more work and UI layout changes. Any thoughts?

davidgamez avatar Jul 03 '23 15:07 davidgamez

Another solution is using streaming to return the response, but I did some investigation and found that streaming is not supported yet, by Netlify functions, even though the under-the-hood AWS lambda functions already do. More info here, https://answers.netlify.com/t/stream-content-to-function-response-body/3558/20.

davidgamez avatar Jul 03 '23 18:07 davidgamez

Another feed example with this error: https://api.entur.io/mobility/v2/gbfs/v3beta/voi/gbfs – found in https://api.entur.io/mobility/v2/gbfs/v3beta/manifest.json.

richfab avatar Jul 04 '23 13:07 richfab

Potential improvement to reduce response payload size (discussed with @PierrickP): stop sending the actual GBFS feed data in the validation response to the client.

For the visualization part, we would still need to pass some GBFS feed data to the client.

richfab avatar Aug 29 '23 18:08 richfab

Would a CE-coded (e.g. gzipped or brotli-compressed) response stay beneath the limit? Highly repetitive text like validation reports compress especially well, likely to <10% of the original size.

For example, if the client requests with Accept-Encoding: gzip, the server can respond with Content-Encoding: gzip and a gzipped body.

derhuerst avatar Sep 07 '23 12:09 derhuerst

@derhuerst Sadly, it already uses Brotli image

PierrickP avatar Sep 07 '23 14:09 PierrickP

Sadly, it already uses Brotli

Is that the Netlify function, or is it the HTTP reverse proxy in front of it?

derhuerst avatar Sep 07 '23 15:09 derhuerst

Directly handled by Netlify. Do you think we can send more if we compress before ?

PierrickP avatar Sep 08 '23 07:09 PierrickP

It's worth a try I'd say!

derhuerst avatar Sep 08 '23 08:09 derhuerst