gbfs-validator
gbfs-validator copied to clipboard
Response payload size exceeded maximum allowed payload size
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" }
Probably nothing to do :\ https://answers.netlify.com/t/lambda-functions-response-size-too-large/22374/2
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?
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.
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.
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.
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 Sadly, it already uses Brotli
Sadly, it already uses Brotli
Is that the Netlify function, or is it the HTTP reverse proxy in front of it?
Directly handled by Netlify. Do you think we can send more if we compress before ?
It's worth a try I'd say!