Cache Management API
REST interface for Dragonfly/Redis operations — supports all major data types: strings, hashes, lists, sets, and sorted sets.
| Field | Value |
|---|---|
| Port | 50035 |
| Base Path | /api/v1/cache |
| OpenAPI | 3.0.1 |
| Spec | Cache_Mgmt_API.json |
Key Management
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/cache/keys/scan | Scan keys with pattern (cursor-based) |
| GET | /api/v1/cache/keys/{key}/type | Get key data type |
| GET | /api/v1/cache/keys/{key}/ttl | Get TTL |
| PUT | /api/v1/cache/keys/{key}/expire | Set expiration |
| PUT | /api/v1/cache/keys/{key}/persist | Remove expiration |
| PUT | /api/v1/cache/keys/{key}/rename | Rename key |
| DELETE | /api/v1/cache/keys/{key} | Delete key |
| DELETE | /api/v1/cache/keys/bulk-delete | Bulk delete by pattern |
String Operations
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/cache/strings/{key} | Get string value |
| PUT | /api/v1/cache/strings/{key} | Set string value |
| DELETE | /api/v1/cache/strings/{key} | Delete string |
// SetStringRequest
{
"value": "string (required)",
"ttlSeconds": 3600,
"condition": "NX | XX"
}
NX = set only if key does not exist. XX = set only if key exists.
Hash Operations
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/cache/hashes/{key} | Get all hash fields |
| GET | /api/v1/cache/hashes/{key}/{field} | Get specific field |
| PUT | /api/v1/cache/hashes/{key} | Set hash fields |
| DELETE | /api/v1/cache/hashes/{key}/{field} | Delete field |
List Operations
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/cache/lists/{key} | Get list range |
| GET | /api/v1/cache/lists/{key}/{index} | Get element at index |
| POST | /api/v1/cache/lists/{key}/push | Push elements |
| POST | /api/v1/cache/lists/{key}/pop | Pop element |
| PUT | /api/v1/cache/lists/{key}/{index} | Set element at index |
| PUT | /api/v1/cache/lists/{key}/trim | Trim list to range |
// ListPushRequest
{
"values": ["value1", "value2"],
"direction": "LEFT | RIGHT"
}
Set Operations
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/cache/sets/{key} | Get all members |
| POST | /api/v1/cache/sets/{key}/add | Add members |
| DELETE | /api/v1/cache/sets/{key}/remove | Remove members |
| GET | /api/v1/cache/sets/{key}/ismember/{member} | Check membership |
| POST | /api/v1/cache/sets/union | Union of sets |
| POST | /api/v1/cache/sets/intersect | Intersection of sets |
| POST | /api/v1/cache/sets/diff | Difference of sets |
Sorted Set Operations
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/cache/zsets/{key} | Get by rank range |
| POST | /api/v1/cache/zsets/{key}/add | Add members with scores |
| DELETE | /api/v1/cache/zsets/{key}/remove | Remove members |
| GET | /api/v1/cache/zsets/{key}/score/{member} | Get member score |
| GET | /api/v1/cache/zsets/{key}/rank/{member} | Get member rank |
| GET | /api/v1/cache/zsets/{key}/range-by-score | Get by score range |
Health
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/cache/health | Health check |
| GET | /api/v1/cache/info | Server info (memory, clients, stats) |
| GET | /api/v1/cache/dbsize | Total key count |
Frontend Integration
| File | Purpose |
|---|---|
services/cacheApi.ts | Cache key operations |
hooks/useCacheManagement.ts | React Query hook |