Prisma · Schema

Prisma Accelerate Cache Strategy

Cache configuration for Prisma Accelerate queries. Defines how query results should be cached using TTL (time-to-live) for fresh cache duration and SWR (stale-while-revalidate) for serving stale data while refreshing in the background. Tags enable targeted cache invalidation of specific query results.

Properties

Name Type Description
ttl integer Time-to-live in seconds. Cached results are served directly for this duration without querying the database. After TTL expires, the cache entry is considered stale.
swr integer Stale-while-revalidate time in seconds. After TTL expires, stale cached results are served to the client while a background refresh fetches fresh data from the database. The SWR window starts after TT
tags array Cache tags for targeted invalidation. Each tag is an alphanumeric string with underscores used to identify groups of cached queries that should be invalidated together.
View JSON Schema on GitHub

JSON Schema

prisma-cache-strategy-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://prisma.io/schemas/cache-strategy.json",
  "title": "Prisma Accelerate Cache Strategy",
  "description": "Cache configuration for Prisma Accelerate queries. Defines how query results should be cached using TTL (time-to-live) for fresh cache duration and SWR (stale-while-revalidate) for serving stale data while refreshing in the background. Tags enable targeted cache invalidation of specific query results.",
  "type": "object",
  "properties": {
    "ttl": {
      "type": "integer",
      "description": "Time-to-live in seconds. Cached results are served directly for this duration without querying the database. After TTL expires, the cache entry is considered stale.",
      "minimum": 1,
      "examples": [60, 300, 3600]
    },
    "swr": {
      "type": "integer",
      "description": "Stale-while-revalidate time in seconds. After TTL expires, stale cached results are served to the client while a background refresh fetches fresh data from the database. The SWR window starts after TTL expiration.",
      "minimum": 1,
      "examples": [60, 300, 3600]
    },
    "tags": {
      "type": "array",
      "description": "Cache tags for targeted invalidation. Each tag is an alphanumeric string with underscores used to identify groups of cached queries that should be invalidated together.",
      "items": {
        "type": "string",
        "pattern": "^[a-zA-Z0-9_]{1,64}$",
        "description": "A cache tag identifier (alphanumeric with underscores, max 64 characters)"
      },
      "maxItems": 5,
      "uniqueItems": true,
      "examples": [["user_list", "active_users"]]
    }
  },
  "additionalProperties": false
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/prisma-cache-strategy"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.