---
title: Cache last value
description: The Last Value Cache (LVC) lets you cache the most recent values for specific fields in a table, improving the performance of queries that return the most recent value of a field for specific series or the last N values of a field. The LVC is an in-memory cache that stores the last N number of values for specific fields of series in a table. When you create an LVC, you can specify what fields to cache, what tags to use to identify each series, and the number of values to cache for each unique se
url: https://docs.influxdata.com/influxdb3/enterprise/api/cache-last-value/
estimated_tokens: 833
product: InfluxDB 3 Enterprise
version: enterprise
publisher: InfluxData
canonical: https://docs.influxdata.com/influxdb3/enterprise/api/cache-last-value/
---

[Download InfluxDB 3 Enterprise API Spec](/openapi/influxdb3-enterprise-openapi.yml)

The Last Value Cache (LVC) lets you cache the most recent
values for specific fields in a table, improving the performance of queries that
return the most recent value of a field for specific series or the last N values
of a field.

The LVC is an in-memory cache that stores the last N number of values for
specific fields of series in a table. When you create an LVC, you can specify
what fields to cache, what tags to use to identify each series, and the
number of values to cache for each unique series.
An LVC is associated with a table, which can have multiple LVCs.

POST`/api/v3/configure/last_cache`

### Create last cache

Creates a last cache for a table.

#### Request bodyrequired

Content-Type:`application/json`

`count`integer

Optional count.

`db`requiredstring

`key_columns`string[]

Optional list of key columns.

`name`string

Optional cache name.

`node_spec`string or object

Specifies which nodes in a multi-node InfluxDB 3 Enterprise cluster
handle the cache or trigger.
Accepts the string `all` or an object that lists specific node IDs.
If omitted, defaults to `all`.

Default:`all`

Example:`"all"`

One of:string

Create the cache or trigger on all nodes in the cluster.

Allowed:`all`

Or:object

Create the cache or trigger only on the specified nodes.

`nodes`requiredstring[]

Node IDs (the `--node-id` value each node was started with).
Each node must exist and must run in `process` mode.

`table`requiredstring

`ttl`integer

Optional time-to-live in seconds.

`value_columns`string[]

Optional list of value columns.

Example request body

```json
{
  "count": 100,
  "db": "mydb",
  "key_columns": [
    "tag1"
  ],
  "table": "mytable",
  "ttl": 3600,
  "value_columns": [
    "field1"
  ]
}
```

Example request[Ask AI about this](#)

```sh
curl --request POST \
  "https://localhost:8181/api/v3/configure/last_cache" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{"count":100,"db":"mydb","key_columns":["tag1"],"table":"mytable","ttl":3600,"value_columns":["field1"]}'
```

#### Responses

201Success. Last cache created.

400Bad request. A cache with this name already exists or the request is malformed.

401Unauthorized access.

`data`object

`error`string

404Cache not found.

DELETE`/api/v3/configure/last_cache`

### Delete last cache

Deletes a last cache.

#### Parameters

##### Query parameters

`db`requiredstring

The name of the database.

`table`requiredstring

The name of the table containing the last cache.

`name`requiredstring

The name of the last cache to delete.

#### Request bodyrequired

Content-Type:`application/json`

Example request[Ask AI about this](#)

```sh
curl --request DELETE \
  "https://localhost:8181/api/v3/configure/last_cache?db=DB&table=TABLE&name=NAME" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json"
```

#### Responses

200Success. The last cache has been deleted.

400Bad request.

401Unauthorized access.

`data`object

`error`string

404Cache not found.

#### Related

* [Manage the Last Value Cache](/influxdb3/enterprise/admin/last-value-cache/)
* [InfluxDB 3 API client libraries](/influxdb3/enterprise/reference/client-libraries/v3/)
