# Cache API

Use the XM Cloud Content Cache API to clear parts of the cache for GraphQL requests. This REST API lets you clean up a cache for a specific tenant. It is rate limited to 10 requests per second per tenant.
{% admonition type="warning" name="Warning" %}Clearing the cache can have a negative effect on the performance of the tenant application because all GraphQL requests must be executed fully. We recommend that you do not clear the caches or call this API as part of a build process.{% /admonition %}
## Authentication
To use this API, you need:
 - The URL of your XM Cloud Content server. You can get this from your XM Cloud Administer.
 - A JWT bearer token requested using the [OAuth Client Credentials flow](https://doc.sitecore.com/xmc/en/developers/xm-cloud/request-a-jwt-for-experience-edge.html). It is sent with every request. The token must include the `cs:all:admin` scope.


Version: 2.0
License: closed source
Metadata:
  - product: SitecoreAI Content

## Servers

```
https://cs-graphqlapi-prod.sitecorecloud.io
```

## Security

### Bearer

A JSON Web Token (JWT) is sent with every call. To obtain one, you need an [access token and the client
        ID](https://doc.sitecore.com/xmc/en/developers/xm-cloud/generate-an-edge-token.html).
        You can create a token [using the Deploy REST API or by requesting one
        to the API
        itself](https://doc.sitecore.com/xmc/en/developers/xm-cloud/request-a-jwt-for-experience-edge.html).

Type: http
Scheme: bearer
Bearer Format: JWT

## Download OpenAPI description

[Cache API](https://api-docs.sitecore.com/_bundle/sai/cache-api/index.yaml)

## Cache

Caching improves performance. Periodically, however, you need to clear parts of the cache for GraphQL requests.


### Clear the cache for a specific branch

 - [DELETE /api/v2/cache/{branch}](https://api-docs.sitecore.com/sai/cache-api/cache/clearall.md): Clears the cache for a specific branch.

### Clear cache query responses for a specific content type

 - [DELETE /api/v2/cache/{branch}/contenttype/{contentType}](https://api-docs.sitecore.com/sai/cache-api/cache/clearbycontenttype.md): Clears the cache of query responses that use a particular content type.

### Clear cache query responses for a specific locale

 - [DELETE /api/v2/cache/{branch}/locale/{locale}](https://api-docs.sitecore.com/sai/cache-api/cache/clearbylocale.md): Clears the cache of query responses that use a particular locale.

### Clear cache query responses for a specific content type and locale

 - [DELETE /api/v2/cache/{branch}/contenttype/{contentType}/locale/{locale}](https://api-docs.sitecore.com/sai/cache-api/cache/clearbycontenttypeandlocale.md): Clears the cache of query responses that use a particular content type and locale.

### Clear cache query responses that use other types of data

 - [DELETE /api/v2/cache/{branch}/other](https://api-docs.sitecore.com/sai/cache-api/cache/clearothers.md): Clears the cache of query responses that use other types of data (not related to content types), such as taxonomies.

