-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Closed
Labels
help wantedIssue with a clear description that the community can help with.Issue with a clear description that the community can help with.
Description
Summary: Allow the data.json file to be loaded in shards for sites with large numbers of pages.
History
Once #4715 lands:
data.jsoncontains a map of allpaths to data file names- File names include a content hash
data.jsonis loaded after the page has finished rendering
Sharding was also discussed in #4626.
Changes
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)Ideally you'd shard by something like path names so a shard for /blog/*, as those are likely to be needed together.
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
Rationale
- On very large sites (>1k pages, or >10k pages) the
data.jsonfile can become large. - It must be fully loaded before prefetching can begin.
- Splitting it into chunks could allow faster prefetching, and require less data over the wire, on very large sites.
This is a low priority enhancement.
JeroenReumkens, jab, baobabKoodaa, FraserThompson and gu-stav
Metadata
Metadata
Assignees
Labels
help wantedIssue with a clear description that the community can help with.Issue with a clear description that the community can help with.