evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A cache-aware HTTP helper that exposes persisted metadata for cached responses while respecting conditional requests and cache invalidation rules.
If-None-Match or If-Modified-Since headers skip cache usage entirely, always contacting the origin and leaving any existing cached entries unchanged. @testexport type HttpMethod = "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "PATCH";
export interface CacheClientOptions {
cachePath: string;
trackedHeaders?: string[];
}
export interface RequestOptions {
method?: HttpMethod;
headers?: Record<string, string>;
body?: string | Buffer;
}
export interface FetchDetails {
status: number;
bodyText: string;
fromCache: boolean;
cachedHeaders: Record<string, string>;
}
export class CacheMetadataClient {
constructor(options: CacheClientOptions);
fetch(url: string, request?: RequestOptions): Promise<FetchDetails>;
clear(): Promise<void>;
}Provides HTTP client with cache storage, metadata headers, and cache invalidation support.