Skip to content

Commit

Permalink
Docs: Add a warning about static queries (#25929)
Browse files Browse the repository at this point in the history
  • Loading branch information
herecydev authored Jul 28, 2020
1 parent 5d27236 commit 59de77d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/docs/conditional-page-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ If you have a large site, you may be able to improve build times for data update

For more info on the standard build process, please see the [overview of the Gatsby build process](/docs/overview-of-the-gatsby-build-process/).

> ❗ Conditional page builds do not currently account for static queries. Any query result differences will not trigger pages to rebuild.
## How to use

To enable conditional page builds, use the environment variable `GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES=true` in your `gatsby build` command, for example:
Expand Down Expand Up @@ -54,6 +56,6 @@ Done in 154.501 sec

- You will need to persist the `.cache` and `public` directories between builds. This allows for comparisons and reuse of previously built files. If `.cache` directory was not persisted then a full build will be triggered. If `public` directory was not persisted then you might experience failing builds or builds that are missing certain assets.

- Any code or static query changes (templates, components, source handling, new plugins etc) will prompt the creation of a new webpack compilation hash and trigger a full build.
- Any code changes (templates, components, source handling, new plugins etc) will prompt the creation of a new webpack compilation hash and trigger a full build.

Note: When using the `GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES` flag it is important to do so consistently when building your project. Otherwise, the cache will be cleared and the necessary data for comparison will no longer be available, removing the ability to check for incremental data changes.

0 comments on commit 59de77d

Please sign in to comment.