# API Reference (/docs/accelerate/reference/api-reference)
> For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL.
API reference documentation for Accelerate
Location: Accelerate > Reference > API Reference
The Accelerate API reference documentation is based on the following schema:
```prisma
model User {
id Int @id @default(autoincrement())
name String?
email String @unique
}
```
All example are based on the `User` model.
## `cacheStrategy` [#cachestrategy]
With the Accelerate extension for Prisma Client, you can use the `cacheStrategy` parameter for model queries and use the [`ttl`](https://www.prisma.io/docs/accelerate/caching) and [`swr`](https://www.prisma.io/docs/accelerate/caching) parameters to define a cache strategy for Accelerate. The Accelerate extension requires that you install Prisma Client version `4.10.0`.
### Options [#options]
The `cacheStrategy` parameter takes an option with the following keys:
| Option | Example | Type | Required | Description |
| ------ | ---------- | ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `swr` | `60` | `Int` | No | The stale-while-revalidate time in seconds. |
| `ttl` | `60` | `Int` | No | The time-to-live time in seconds. |
| `tags` | `["user"]` | `String[]` | No | The `tag` controls the invalidation of specific queries within your application. It is an optional array of strings to [invalidate](https://www.prisma.io/docs/accelerate/reference/api-reference#accelerateinvalidate) the cache, with each tag containing only alphanumeric characters and underscores, and a maximum length of 64 characters. |
|
### Examples [#examples]
Add a caching strategy to the query, defining a 60-second stale-while-revalidate (SWR) value, a 60-second time-to-live (TTL) value, and a cache tag of `"emails_with_alice"`:
```ts highlight=7:11;normal
await prisma.user.findMany({
where: {
email: {
contains: "alice@prisma.io",
},
},
cacheStrategy: {
// [!code highlight]
swr: 60, // [!code highlight]
ttl: 60, // [!code highlight]
tags: ["emails_with_alice"], // [!code highlight]
}, // [!code highlight]
});
```
### Supported Prisma Client operations [#supported-prisma-client-operations]
The following is a list of all read query operations that support `cacheStrategy`:
* [`findUnique()`](https://www.prisma.io/docs/orm/v7/reference/prisma-client-reference#findunique)
* [`findUniqueOrThrow()`](https://www.prisma.io/docs/orm/v7/reference/prisma-client-reference#finduniqueorthrow)
* [`findFirst()`](https://www.prisma.io/docs/orm/v7/reference/prisma-client-reference#findfirst)
* [`findFirstOrThrow()`](https://www.prisma.io/docs/orm/v7/reference/prisma-client-reference#findfirstorthrow)
* [`findMany()`](https://www.prisma.io/docs/orm/v7/reference/prisma-client-reference#findmany)
* [`count()`](https://www.prisma.io/docs/orm/v7/reference/prisma-client-reference#count)
* [`aggregate()`](https://www.prisma.io/docs/orm/v7/reference/prisma-client-reference#aggregate)
* [`groupBy()`](https://www.prisma.io/docs/orm/v7/reference/prisma-client-reference#groupby)
The `cacheStrategy` parameter is not supported on any write operations, such as `create()`.
## `withAccelerateInfo` [#withaccelerateinfo]
Any query that supports the `cacheStrategy` can append `withAccelerateInfo()` to wrap the response data and include additional information about the Accelerate response.
To retrieve the status of the response, use:
```ts
const { data, info } = await prisma.user
.count({
cacheStrategy: { ttl: 60, swr: 600 },
where: { myField: "value" },
})
.withAccelerateInfo();
console.dir(info);
```
Notice the `info` property of the response object. This is where the request information is stored.
### Return type [#return-type]
The `info` object is of type `AccelerateInfo` and follows the interface below:
```ts
interface AccelerateInfo {
cacheStatus: "ttl" | "swr" | "miss" | "none";
lastModified: Date;
region: string;
requestId: string;
signature: string;
}
```
| Property | Type | Description |
| -------------- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cacheStatus` | `"ttl" \| "swr" \| "miss" \| "none" ` | The cache status of the response.