diff --git a/pages/01.basics/05.grav-configuration/docs.md b/pages/01.basics/05.grav-configuration/docs.md index c8518901a..c1be5549c 100644 --- a/pages/01.basics/05.grav-configuration/docs.md +++ b/pages/01.basics/05.grav-configuration/docs.md @@ -142,6 +142,7 @@ The **Pages** section of the `system/config/system.yaml` file is where you set a - **markdown**: Enable or disable the processing of markdown on the front end. Can be set `true` or `false`. - **twig**: Enable or disable the processing of twig on the front end. Can be set `true` or `false`. * **twig_first**: Process Twig before markdown when processing both on a page. Can be set `true` or `false`. +* **never_cache_twig**: Enabling this will allow you to add a processing logic that can change dynamically on each page load, rather than caching the results and storing it for each page load. This can be enabled/disabled site-wide in the **system.yaml**, or on a specific page. Can be set `true` or `false`. * **events**: - **page**: Enable page-level events. Can be set `true` or `false`. - **twig**: Enable Twig-level events. Can be set `true` or `false`. diff --git a/pages/02.content/02.headers/docs.md b/pages/02.content/02.headers/docs.md index 6cde811a0..a553f5d61 100644 --- a/pages/02.content/02.headers/docs.md +++ b/pages/02.content/02.headers/docs.md @@ -229,6 +229,18 @@ By default, Grav will cache the contents of the page file to ensure things run a An example of this is when you are using dynamic Twig variables in your content. The `cache_enable` variable allows this behavior to be overridden. We will cover Twig Content variables in a later chapter. Valid values are `true` or `false`. +### Never Cache Twig + +```ruby +never_cache_twig: true +``` + +Enabling this will allow you to add a processing logic that can change dynamically on each page load, rather than caching the results and storing it for each page load. This can be enabled/disabled site-wide in the **system.yaml**, or on a specific page. Can be set `true` or `false`. + +This is a subtle change, but one that is especially useful in modular pages as it keeps you from having to constantly disable caching when you're working with it. The page is still cached, but not the Twig. The Twig is processed after the cached content is retrieved. For modular forms, it now works with just this setting rather than having to disable the modular page cache. + +!! This is not compatible with `twig_first: true` currently because all processing is happening in the one Twig call. + ### Process ```ruby