Skip to content

Conversation

@talatuyarer
Copy link
Contributor

Every time we build the docs, the mkdocs-monorepo-plugin rebuilds all 14+ versioned documentation of projects even though these old versions never change. This makes iterative development very slow.

I created A development mode that only builds nightly and latest versions to make builds are fast. The production mode still builds all versions which means slow :)

Based on my machine performance it makes 5x more faster. --dirty flag makes even faster iterative rebuilds

How to use

Dev Mod

cd site
make serve-dev  # Only builds nightly + latest

Full production mode

cd site
make serve      # Builds all 14 versions (use before PRs)

Closes #14124

cc @kevinjqliu @RussellSpitzer

Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. I had to take some time to understand mkdocs' behavior.

Feels like we're on the right path here. From my understanding, there are 2 major issues with building docs locally:

  1. nav.yml references all previous versions of the docs
  2. mkdocs automatically load all directories inside docs/docs/ and docs/javadoc/

We can resolve (1) by overriding the nav component. We can resolve (2) by using exclude_docs to exclude all other versions.

I tested this out locally and was able to get build done in ~45 seconds.
Instead of replacing nav.yml (which is error-prone imo), I created a new mkdocs-dev.yml and references it in serve-dev.sh

I can push up my local changes if you want to take a look

@github-actions github-actions bot removed the INFRA label Nov 5, 2025
@kevinjqliu
Copy link
Contributor

@talatuyarer pushed up some of my local changes, as we discussed offline.

Please take a look and see if this is also working for you locally 😄

@kevinjqliu
Copy link
Contributor

INFO - Documentation built in 9.59 seconds

supa fast!

Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

so much faster now

@kevinjqliu kevinjqliu merged commit 8cefa38 into apache:main Nov 6, 2025
4 checks passed
@kevinjqliu
Copy link
Contributor

Thanks @talatuyarer !

- Java:
- Nightly: '!include docs/docs/nightly/mkdocs.yml'
- Latest (1.10.0): '!include docs/docs/latest/mkdocs.yml'
- Other Implementations:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether we can avoid copying other parts of mkdocs.yml. It will be easier to maintain.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, this is more of a short term solution. both nightly and latest are just sym links to the actual "latest version" (1.10).

long term i want to explore using mike for versioning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Site Build Time

3 participants