---
title: "GET /datasources/{dataSourceUID}/cache"
method: GET
path: "/datasources/{dataSourceUID}/cache"
tags: ["enterprise"]
---

# GET /datasources/{dataSourceUID}/cache

`GET /datasources/{dataSourceUID}/cache`

## Request

- Base URL: `/api` (relative, and the document’s source URL is not known)
- URL: `/api/datasources/{dataSourceUID}/cache`
- Auth: one of:
  - HTTP basic
  - API key in header `Authorization`

get cache config for a single data source

## Path parameters

- `dataSourceUID` string, required

## Query parameters

- `dataSourceType` string

## Response `200`

CacheConfigResponse

- CacheConfigResponse
  - `created` string, date-time
  - `dataSourceID` integer: Fields that can be set by the API caller - read/write
  - `dataSourceUID` string
  - `defaultTTLMs` integer: These are returned by the HTTP API, but are managed internally - read-only Note: 'created' and 'updated' are special properties managed automatically by xorm, but we are setting them manually
  - `enabled` boolean
  - `message` string
  - `ttlQueriesMs` integer: TTL MS, or "time to live", is how long a cached item will stay in the cache before it is removed (in milliseconds)
  - `ttlResourcesMs` integer
  - `updated` string, date-time
  - `useDefaultTTL` boolean: If UseDefaultTTL is enabled, then the TTLQueriesMS and TTLResourcesMS in this object is always sent as the default TTL located in grafana.ini

## Other responses

- `500`: InternalServerError is a general error indicating something went wrong internally.

---

[API](https://skmtc.dev/grafana/apis/grafana-http-api.md) - [All operations](https://skmtc.dev/grafana/apis/grafana-http-api/llms.txt) - [OpenAPI document](https://skmtc.dev/grafana/apis/grafana-http-api/revisions/df55ba1718ba?raw)
