/** * SEO Cache Manager * * Extends the base cache manager with SEO-specific caching strategies * and invalidation patterns. Provides optimized caching for SEO analysis, * schema generation, and audit results. * * @since 2.7.0 */ import { CacheManager } from "./CacheManager.js"; /** * SEO-specific cache manager * * Implements specialized caching strategies for SEO operations: * - Content analysis results (6 hour default TTL) * - Schema markup (24 hour default TTL) * - Site audits (1 hour default TTL) * - Keyword research (7 day default TTL) * - SERP data (12 hour default TTL) */ export declare class SEOCacheManager extends CacheManager { private readonly SEO_CACHE_PREFIX; private readonly logger; private readonly seoConfig; /** * Default TTL values for different SEO operations */ private readonly DEFAULT_TTL; constructor(); /** * Get SEO-specific cache key * * @param type - Type of SEO operation * @param site - Site identifier * @param identifier - Unique identifier (post ID, etc.) * @param suffix - Additional suffix for uniqueness * @returns Formatted cache key */ getSEOCacheKey(type: keyof typeof this.DEFAULT_TTL, site: string, identifier: string | number, suffix?: string): string; /** * Cache SEO analysis result * * @param postId - WordPress post ID * @param analysisType - Type of analysis performed * @param result - Analysis result to cache * @param site - Site identifier * @param ttl - Optional custom TTL */ cacheAnalysis(postId: number, analysisType: string, result: unknown, site?: string, ttl?: number): Promise; /** * Get cached SEO analysis result * * @param postId - WordPress post ID * @param analysisType - Type of analysis * @param site - Site identifier * @returns Cached result or null */ getCachedAnalysis(postId: number, analysisType: string, site?: string): unknown | null; /** * Cache schema markup * * @param postId - WordPress post ID * @param schemaType - Type of schema * @param schema - Schema markup to cache * @param site - Site identifier * @param ttl - Optional custom TTL */ cacheSchema(postId: number, schemaType: string, schema: unknown, site?: string, ttl?: number): Promise; /** * Get cached schema markup * * @param postId - WordPress post ID * @param schemaType - Type of schema * @param site - Site identifier * @returns Cached schema or null */ getCachedSchema(postId: number, schemaType: string, site?: string): unknown | null; /** * Cache site audit results * * @param auditType - Type of audit performed * @param result - Audit results * @param site - Site identifier * @param ttl - Optional custom TTL */ cacheAudit(auditType: string, result: unknown, site?: string, ttl?: number): Promise; /** * Get cached audit results * * @param auditType - Type of audit * @param site - Site identifier * @returns Cached audit or null */ getCachedAudit(auditType: string, site?: string): unknown | null; /** * Invalidate all SEO cache for a specific post * * Called when a post is updated to ensure fresh SEO analysis * * @param postId - WordPress post ID * @param site - Site identifier */ invalidatePostSEO(postId: number, site?: string): Promise; /** * Invalidate all SEO cache for a site * * Called during major updates or when site-wide changes occur * * @param site - Site identifier */ invalidateSiteSEO(site?: string): Promise; /** * Invalidate cache entries matching a pattern * * @param pattern - Cache key pattern to match * @private */ private invalidatePattern; /** * Get cache statistics for SEO operations * * @returns Object with cache statistics */ getSEOCacheStats(): { totalEntries: number; byType: Record; hitRate: number; }; /** * Preload cache with common SEO data * * Useful for warming up the cache with frequently accessed data * * @param site - Site identifier * @param postIds - Array of post IDs to preload */ preloadSEOCache(site?: string, postIds?: number[]): Promise; /** * Get all cache keys from the base cache manager * * @private */ private getAllKeys; /** * Clear all SEO-related cache entries */ clearSEOCache(): Promise; } export declare const seoCache: SEOCacheManager; //# sourceMappingURL=SEOCacheManager.d.ts.map