Guides

Managed Cache

Intermediate~10 min

Create project-scoped Meteorack Cache databases, issue connection tokens, and run Redis-compatible commands over REST or RESP.

Prerequisites

  • A Meteorack project. Use an empty project if the cache is the only service you need.
  • A workspace API key for management calls, or dashboard access to Project > Cache.
  • A cache connection token for data-plane commands.

What You Will Finish With

  • Understand the difference between management APIs and cache data-plane APIs.
  • Create and revoke scoped cache connection tokens.
  • Run PING, SET, and GET from REST and Redis-compatible clients.

Meteorack Cache is a project-scoped, Redis-compatible cache service. Use it for session lookups, computed API responses, queues with short-lived state, and application data that can be rebuilt from a durable source.

There are two API surfaces:

SurfaceBase URLAuthPurpose
Management APIhttps://api.meteorack.comWorkspace API keyList cache databases, inspect current usage, create or revoke cache connection tokens.
Data planehttps://cache.meteorack.app and cache.meteorack.app:6380Cache connection tokenRun Redis-compatible commands over REST or RESP.

Do not use a workspace API key as a cache token. Workspace API keys manage resources; cache connection tokens run cache commands.

Create a cache

Open Project > Cache in the dashboard, create a cache service, and wait until the cache status is active. Cache-only projects should use an empty project and add Cache as the first service.

The Connect tab shows:

  • REST endpoint
  • Redis-compatible host and port when direct client access is available
  • database id
  • limits
  • one-time token secret after token creation
  • runnable cURL, TypeScript, Python, and redis-cli snippets

Store token secrets in your application secret manager. Existing token secrets cannot be revealed again; create a new token if a secret is lost.

Management API

Management calls use a workspace API key with project access.

Required scopes:

OperationScope
List cache databases and current-month usagecloud.cache:read
List connection token metadatacloud.cache:admin
Create a connection tokencloud.cache:admin
Revoke a connection tokencloud.cache:admin

List cache databases:

curl -fsS "https://api.meteorack.com/api/v1/cloud/projects/$PROJECT_ID/cache" \
  -H "Authorization: Bearer $METEORACK_API_KEY"

Create a connection token:

curl -fsS -X POST "https://api.meteorack.com/api/v1/cloud/projects/$PROJECT_ID/cache/tokens" \
  -H "Authorization: Bearer $METEORACK_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
    "cache_database_id": "'"$CACHE_DATABASE_ID"'",
    "name": "web worker",
    "access_mode": "read_write"
  }'

The token secret is returned only once:

{
  "data": {
    "token": {
      "api_key_id": "44444444-4444-4444-8444-444444444444",
      "cache_database_id": "33333333-3333-4333-8333-333333333333",
      "name": "web worker",
      "key_prefix": "mk_live_cache_ab",
      "access_mode": "read_write",
      "secret": "mk_live_cache_...",
      "warning": "Secret is shown once. Store it securely."
    }
  }
}

Revoke a connection token:

curl -fsS -X DELETE \
  "https://api.meteorack.com/api/v1/cloud/projects/$PROJECT_ID/cache/tokens/$CACHE_TOKEN_API_KEY_ID" \
  -H "Authorization: Bearer $METEORACK_API_KEY"

REST commands

REST commands use a cache connection token:

curl -fsS -X POST "https://cache.meteorack.app/commands" \
  -H "Authorization: Bearer $METEORACK_CACHE_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"command":"PING","args":[]}'

The response body contains the command result:

{ "result": "PONG" }

Set and read a short-lived value:

curl -fsS -X POST "https://cache.meteorack.app/commands" \
  -H "Authorization: Bearer $METEORACK_CACHE_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"command":"SET","args":["session:1","warm","EX","60"]}'

curl -fsS -X POST "https://cache.meteorack.app/commands" \
  -H "Authorization: Bearer $METEORACK_CACHE_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"command":"GET","args":["session:1"]}'

REST command responses always send Cache-Control: no-store.

Redis-compatible clients

Create a Redis-compatible URL from the Connect tab or token dialog, then pass it to a client that supports TLS:

redis-cli -u "$METEORACK_CACHE_REDIS_URL" PING
redis-cli -u "$METEORACK_CACHE_REDIS_URL" SET session:1 warm EX 60
redis-cli -u "$METEORACK_CACHE_REDIS_URL" GET session:1

For application code, keep the token in an environment variable and rebuild the URL at process start. Rotate by creating a new token, deploying the new secret, then revoking the old token.

Access modes

Access modeWhat it can do
read_onlyRead commands for one cache database.
read_writeRead and write commands for one cache database.
adminAdministrative cache operations for one cache database. Use sparingly.

Tokens are bound to one cache database and one project. A token for one cache database cannot act as a broad workspace API key.

Supported commands

Meteorack Cache allows only commands with explicit tenant-safe key parsing. Unsupported commands fail closed.

FamilySupported commands
Connection and diagnosticsPING, ECHO
Generic keysDEL, UNLINK, EXISTS, EXPIRE, PEXPIRE, TTL, PTTL, PERSIST, TYPE, SCAN
StringsGET, MGET, SET, MSET, INCR, INCRBY, DECR, DECRBY
HashesHGET, HSET, HMGET, HGETALL, HDEL, HEXISTS, HLEN, HSCAN
ListsLPUSH, RPUSH, LPOP, RPOP, LRANGE, LLEN, LTRIM
SetsSADD, SREM, SCARD, SISMEMBER, SMEMBERS, SSCAN
Sorted setsZADD, ZREM, ZSCORE, ZCARD, ZRANGE, ZREVRANGE, ZSCAN

Blocked command families:

ACL, BGSAVE, CLIENT, CLUSTER, CONFIG, DEBUG, EVAL, EVALSHA, FLUSHALL, FLUSHDB, KEYS, MIGRATE, MODULE, PUBLISH, REPLICAOF, SAVE, SCRIPT, SHUTDOWN, SUBSCRIBE

Pub/Sub, Lua scripting, global flushes, raw key enumeration, backend configuration, and replication controls are not part of the shared managed cache surface.

Errors

REST command errors include a stable code:

HTTP statusExample codeMeaning
401missing_token, invalid_tokenThe cache token is missing, revoked, expired, or invalid.
402cache_billing_suspendedPayment is required before commands can continue.
403insufficient_scope, blocked_command, database_suspendedThe token or database is not allowed to run the command.
409service_provisioning, database_provisioningThe cache is not active yet.
429rate_limitedThe cache hit its command limit.
503backend_unavailable, cache_billing_unavailableA runtime dependency is temporarily unavailable.

Clients should retry 503 with backoff, back off on 429, and require operator or customer action for 401, 402, and most 403 responses.

Pulse Edge

Meteorack Cache and Pulse Edge solve different problems. Meteorack Cache stores application data that your code reads and writes. Pulse Edge caches HTTP responses and handles edge performance workflows. RESP traffic does not route through Pulse Edge.