---
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/core/api/cache-last-value/
estimated_tokens: 2699
product: InfluxDB 3 Core
version: core
---

[Download InfluxDB 3 Core API Spec](/openapi/influxdb3-core-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 body required

Content-Type: `application/json`

`count` integer

Optional count.

`db` required string

`key_columns` string\[\]

Optional list of key columns.

`name` string

Optional cache name.

`table` required string

`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

201 Success. Last cache created.

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

401 Unauthorized access.

`data` object

`error` string

404 Cache not found.

DELETE `/api/v3/configure/last_cache`

### Delete last cache

Deletes a last cache.

#### Parameters

##### Query parameters

`db` required string

The name of the database.

`table` required string

The name of the table containing the last cache.

`name` required string

The name of the last cache to delete.

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"
```

#### Responses

200 Success. The last cache has been deleted.

400 Bad request.

401 Unauthorized access.

`data` object

`error` string

404 Cache not found.

#### Related

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