Summary: Allow the data.json file to be loaded in shards for sites with large numbers of pages.
Once #4715 lands:
data.json contains a map of all paths to data file namesdata.json is loaded after the page has finished renderingSharding was also discussed in #4626.
Rather than loading data.json as a single file, it could be split into multiple files based on a simple sharding mechanism, for example:
const calculateShardNameForId(shardLength: int, id: string) => md5(id).substr(0, shardLength)
@KyleAMathews mentioned:
Ideally you'd shard by something like path names so a shard for /blog/*, as those are likely to be needed together.
@pieh shared:
Just to give more info - when I run my tests against https://github.com/freeCodeCamp/guides (~2800 pages) - gzipped "webpackified" data.json is 141KB - this surely won't scale very nice for 100 000 pages sites, but up to 10 000 I think this shouldn't be that much of a issue
data.json file can become large.This is a low priority enhancement.
I have an open PR for this https://github.com/gatsbyjs/gatsby/pull/6651
Definitely needs done for Gatsby to scale to larger sites.
Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open!
gatsbyjs.org's page metadata chunk is up to 451kbs yikes 馃槵
Related to #13004
Fixed in #13004, and available in [email protected] 馃帀 Huge thanks to @Moocar and everyone involved in reviewing and testing this feature 馃挏
Most helpful comment
Definitely needs done for Gatsby to scale to larger sites.