Open eyeseast opened 1 day ago
This is the underlying error:
Function.ResponseSizeTooLarge - Response payload size exceeded maximum allowed payload size (6291556 bytes).
So we're somehow sending a giant response.
I think the issue is all the fetch
data that gets rendered into the page. View source on this for an example: https://next.www.documentcloud.org/documents/23813897-mueller/. That page is more than 2 mb, and Lambda functions have a hard 6 mb limit.
I bet it's the text. Since we're fetching it all, it gets rendered on the page. That document is 1,774 long, which is a lot of text to dump on the page.
One idea: We load only the first page of text on the server, and then load the full text in onMount
. We still get some SEO benefit, but we're not sending all that text through Lambda. Need to see how this messes with pagination, though. We couldn't go to a text page until text is loaded.
This page is crashing: https://next.www.documentcloud.org/documents/4448659-2017-EPA-Staff-Calendars-Part2-S/
Logs:
Not sure what that means. The response is failing before it gets to Cloudflare.