I have a Gatsby website creating ~86k pages (and I will need many more, probably 500k in the long term).
As it takes a lot of time to build and deploy (approx. 25minutes) I would like to use DSG or SSR on the vast majority of pages.
However, the gatsby-plugin-netlify generates a pair of redirects for each pages.
That makes the _redirects file too large for netlify to process.
Here is the site ID : 5fbdd0db-d4cd-4163-8ee6-6f12847fa2e9
Here is a build log that shows the issue: Netlify App
And a few excerpts for everybody to read:
In the Building step
9:59:32 AM: info [gatsby-plugin-netlify] Created 63344 SSR/DSG redirects...
In the Post-processing step
10:06:36 AM: Post processing - redirect rules
10:06:41 AM: Redirect rule files are too large. Please reduce the combined size of /_redirects and /netlify.toml
Yeah, this is starting to look more like some platform-limits at this point. It’s definitely not possible to increae the limit for number of redirects as those limits are imposed by MongoDB.
Looks like the number of redirects required for adding the DSG support would have to be reduced or some other way needs to be introduced.
Can you please run a build locally using Netlify CLI? You can use the command netlify build and attach the geneated _redirects file?
The only solution I can think of in the meanwhile for you is to delete the generated _redirects file and create one yourself. You can do this as a Shell script or a Node.js script.