tessl install tessl/pypi-requests-cache@1.2.0A 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%
A utility that monitors and maintains the health of an HTTP response cache by identifying and removing corrupted or invalid cached entries.
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.
@generates
The implementation should:
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
"""
passProvides HTTP response caching with cache inspection and filtering capabilities.