---
schema_version: "1"
id: 95a9457671e2858cc20d910ba04d1638457e87197f17b8b39f852abf3caedb36
title: Invalidate Key (<ee:invalidate-key/>)
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/anypoint-code-builder/acb-component-invalidate-key.md
canonical_url: https://docs.mulesoft.com/anypoint-code-builder/acb-component-invalidate-key
source_site: docs.mulesoft.com
content_type: documentation
content_hash: ef5960f4290594e99b16a38f7c90ee99634421a78da2101e7253aca25d5e8ad8
description: MuleSoft Documentation Site
latest: true
---
---
product: Anypoint Code Builder
version: master
---

# Invalidate Key (<ee:invalidate-key/>)

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Invalidate a single cache key in the referenced caching strategy.

## Component XML

This component supports the following XML structure:

```xml
<ee:invalidate-key
  cachingStrategy-ref=""
  doc:name="Invalidate key"
  doc:id="ezsaex" />
```

Invalidate Key (`<ee:invalidate-key/>`) attributes are configurable through the UI and XML.

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute Name</th><th>Attribute XML</th><th>Description</th></tr></thead><tbody><tr><td><p><strong>Invalidate key</strong> (default)</p></td><td><p><code>doc:name</code></p></td><td><div><div><p>Editable name for the component to display in the canvas.</p></div></div></td></tr><tr><td><p>N/A</p></td><td><p><code>doc:id</code></p></td><td><div><div><p>Automatically generated identifier for the component.</p></div></div></td></tr><tr><td><p><strong>Cachingstrategy ref</strong></p></td><td><p><code>cachingStrategy-ref</code></p></td><td><div><div><p>Reference to the caching strategy for the cache key to invalidate.</p></div></div></td></tr><tr><td><p><strong>Key generation expression</strong></p></td><td><p><code>keyGenerationExpression</code></p></td><td><div><div><p>Optional. A DataWeave expression to generate the key to invalidate. Use the same expression configured in the caching strategy that generated the key.</p></div></div></td></tr><tr><td><p><strong>Keygenerator ref</strong></p></td><td><p><code>keyGenerator-ref</code></p></td><td><div><div><p>N/A</p></div></div></td></tr></tbody></table>

## Examples

The following example invalidates a cache key:

```xml
<!-- Caching strategy configuration -->
<ee:object-store-caching-strategy name="myCachingStrategy" keyGenerationExpression="#[payload.key]" />

<flow name="cacheFlow">
  <ee:cache cachingStrategy-ref="myCachingStrategy">
      <!-- Processing logic inside the Cache Scope -->
  </ee:cache>
</flow>

<flow name="invalidateItemFlow">
  <!-- Invalidate Key component configuration -->
  <ee:invalidate-key cachingStrategy-ref="myCachingStrategy" keyGenerationExpression="#[payload.key]" />
</flow>
```

## See Also

- [Cache Scope](https://docs.mulesoft.com/anypoint-code-builder/acb-component-cache)

- [Invalidate Cache](https://docs.mulesoft.com/anypoint-code-builder/acb-component-invalidate-cache)
