/** * HTTP-level caching wrapper with ETags and Cache-Control headers * Implements WordPress REST API caching best practices */ import { CacheManager } from "./CacheManager.js"; export interface HttpCacheOptions { ttl?: number; cacheControl?: string; varyHeaders?: string[]; private?: boolean; revalidate?: boolean; } export interface CachedResponse { data: unknown; status: number; headers: Record; etag?: string; lastModified?: string; cacheControl?: string; } export interface RequestOptions { method: string; url: string; headers?: Record; params?: Record; data?: unknown; } /** * HTTP caching wrapper that adds intelligent caching to HTTP requests */ export declare class HttpCacheWrapper { private cacheManager; private siteId; private logger; constructor(cacheManager: CacheManager, siteId: string); /** * Execute request with intelligent caching */ request(requestFn: (extraHeaders?: Record) => Promise<{ data: T; status: number; headers: Record; }>, options: RequestOptions, cacheOptions?: HttpCacheOptions): Promise<{ data: T; status: number; headers: Record; cached?: boolean; }>; /** * Invalidate cache for specific endpoint */ invalidate(endpoint: string, params?: Record): void; /** * Invalidate cache entries matching pattern */ invalidatePattern(pattern: string): number; /** * Invalidate all cache for this site */ invalidateAll(): number; /** * Pre-warm cache with data */ warm(endpoint: string, data: T, params?: Record, cacheOptions?: HttpCacheOptions): void; /** * Get cache statistics for this site */ getStats(): import("./CacheManager.js").CacheStats; /** * Generate cache key for request */ private generateCacheKey; /** * Extract endpoint from full URL */ private extractEndpoint; /** * Extract headers that affect caching */ private extractCacheableHeaders; /** * Execute request with modified headers */ /** * Cache response and return with cache metadata */ private cacheAndReturn; /** * Generate ETag for response data */ private generateETag; /** * Get default TTL based on endpoint type */ private getDefaultTTL; /** * Get default Cache-Control header based on endpoint */ private getDefaultCacheControl; /** * Generate cache headers */ private generateCacheHeaders; /** * Check if endpoint contains static data */ private isStaticEndpoint; /** * Check if endpoint contains semi-static data */ private isSemiStaticEndpoint; /** * Check if endpoint is session-related */ private isSessionEndpoint; /** * Extract endpoint from cache key */ private extractEndpointFromKey; } //# sourceMappingURL=HttpCacheWrapper.d.ts.map