Cached response with metadata

interface CachedResponse<T> {
    data: T;
    timestamp: number;
    requestedAt: number;
    receivedAt: number;
    path: string;
    method: string;
    expiresAt?: number;
}

Type Parameters

  • T = unknown

Properties

data: T

The response data

timestamp: number

When the response was cached (timestamp)

Deprecated

Use requestedAt or receivedAt for temporal comparisons

requestedAt: number

When the HTTP request was sent (timestamp) Used for baseline-delta temporal filtering

receivedAt: number

When the HTTP response was received (timestamp) Used for baseline-delta temporal filtering

path: string

The API path this response came from

method: string

The HTTP method used

expiresAt?: number

When this response expires (for TTL retention)