> For the complete documentation index, see [llms.txt](https://mariohernandez.gitbook.io/components/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariohernandez.gitbook.io/components/a-components-lifecycle/cache-debug.md).

# Drupal cache & twig debugging

Before we begin integrating components with Drupal, there are some preparation to be done and some practices to understand.

### What is component integration?

At a high level, component integration means wiring Drupal Twig templates to pre-built components from a design system such as Pattern Lab. By default Drupal has no knowledge of any components in Pattern Lab, but with the [Component Libraries](https://www.drupal.org/project/components) module and through the use of Presenter templates, we make Drupal aware of components so they get rendered using Drupal data while keeping Pattern Lab as the single source of truth for the component's markup, styles and javascript.

### Disable Drupal Caching and enable Twig debugging (during development only)

Twig debugging is not required for integrating components but it is highly recommended as this will make your job easier. Disabling caching and enabling Twig debugging during development will allow us to identify the right Drupal templates we need to work with to integrate components. These templates are typically know as template suggestion. More on this shortly.

{% hint style="info" %}
\*\*DO THIS: \*\*[Follow these instructions](https://www.drupal.org/node/2598914) to disable Drupal caching and enable debugging during development. Depending on your environment, these instructions may vary.
{% endhint %}

{% hint style="warning" %}
**WARNING**: Disabling Drupal caching and enabling Twig debugging should never be done on a production website. This is only recommended in a development environment.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mariohernandez.gitbook.io/components/a-components-lifecycle/cache-debug.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
