• Checks if a cache entry exists and is not expired.

    Parameters

    • key: string

      Cache key to validate.

    Returns boolean

    True if entry exists and has not exceeded CACHE_EXPIRY; false otherwise.

    export function isCacheValid(key: string): boolean {
    const entry = mangaCache[key];
    if (!entry) return false;
    return Date.now() - entry.timestamp < CACHE_EXPIRY;
    }