tessl install tessl/pypi-hishel@0.1.0Persistent cache implementation for httpx and httpcore following RFC 9111 specification
Agent Success
Agent success rate when using this tile
74%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.48x
Baseline
Agent success rate without this tile
50%
Build a simple HTTP client utility that demonstrates cache revalidation behavior when the no-cache directive is used in request headers.
Create a Python script that makes HTTP requests with caching enabled. The script should:
Cache-Control: no-cache in the request headers (should force revalidation even if cache is fresh)The script should accept a URL as a command-line argument and print information about each request showing cache behavior.
Cache-Control: no-cache header, the cached response is not used directly and revalidation occurs @testno-cache directive to a previously cached URL, the cached response is used without revalidation @testFor each request, print:
@generates
#!/usr/bin/env python3
"""
HTTP cache revalidation demonstration tool.
"""
def make_request_with_cache(url: str, use_no_cache: bool = False) -> dict:
"""
Make an HTTP request with caching enabled.
Args:
url: The URL to request
use_no_cache: If True, add Cache-Control: no-cache to request headers
Returns:
dict with keys: 'from_cache', 'revalidated', 'status_code'
"""
pass
def main():
"""
Main entry point. Demonstrates cache behavior with and without no-cache directive.
"""
pass
if __name__ == "__main__":
main()Provides HTTP caching for Python with RFC 9111 compliance.