From 59de77d7de6e2bc5b36c01dc619cdf8ca5d830b8 Mon Sep 17 00:00:00 2001 From: Dan Kirkham Date: Tue, 28 Jul 2020 09:13:08 +0100 Subject: [PATCH] Docs: Add a warning about static queries (#25929) --- docs/docs/conditional-page-builds.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/docs/conditional-page-builds.md b/docs/docs/conditional-page-builds.md index f34a8037c4cba..6bf4fa0aead89 100644 --- a/docs/docs/conditional-page-builds.md +++ b/docs/docs/conditional-page-builds.md @@ -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: @@ -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.