CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-requests-cache

tessl install tessl/pypi-requests-cache@1.2.0

A persistent cache for python requests

Agent Success

Agent success rate when using this tile

76%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.27x

Baseline

Agent success rate without this tile

60%

task.mdevals/scenario-10/

HTTP Cache Validator

A utility that monitors and maintains the health of an HTTP response cache by identifying and removing corrupted or invalid cached entries.

Background

When caching HTTP responses, serialization or deserialization errors can result in invalid cached entries. These corrupted entries should be identified and removed to maintain cache integrity and prevent application failures.

Capabilities

Cache Health Monitoring

  • Creates a cached session and makes multiple HTTP requests that will be cached @test
  • Identifies all cached responses that have become invalid due to deserialization failures @test
  • Distinguishes between valid cached responses, expired responses, and invalid responses @test

Invalid Entry Removal

  • Removes all invalid cached responses from the cache @test
  • Preserves valid cached responses (both expired and non-expired) during cleanup @test
  • Confirms successful removal of invalid entries @test

Implementation

@generates

The implementation should:

  1. Create a cache session
  2. Make several HTTP requests to populate the cache
  3. Intentionally corrupt some cached entries by modifying the underlying storage
  4. Filter the cache to identify invalid responses
  5. Delete all invalid responses
  6. Verify that only invalid entries were removed

API

def validate_and_clean_cache(cache_name: str) -> dict:
    """
    Validates cached HTTP responses and removes invalid entries.

    Args:
        cache_name: Name/path of the cache to validate

    Returns:
        Dictionary with keys:
        - 'total_entries': Total number of cached entries before cleanup
        - 'invalid_count': Number of invalid entries found
        - 'deleted_count': Number of entries deleted
        - 'remaining_entries': Number of entries after cleanup
    """
    pass

Dependencies { .dependencies }

requests-cache { .dependency }

Provides HTTP response caching with cache inspection and filtering capabilities.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/requests-cache@1.2.x
tile.json