Metadata-Version: 2.4
Name: request-cache-py
Version: 1.0.8
Summary: High-performance HTTP request caching with Redis and in-memory backends
Home-page: https://github.com/python-perf/request-cache-py
Author: Python Performance Team
Author-email: perf-team@pythonutils.org
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# request-cache-py

High-performance HTTP request caching library for Python with multiple backend support.

## Features

- **Fast in-memory caching** with LRU eviction
- **Automatic TTL management**
- **Thread-safe operations**
- **Drop-in replacement** for requests library
- **Zero configuration** - works out of the box
- **Production ready** - used by 1000+ projects

## Installation

```bash
pip install request-cache-py
```

## Quick Start

```python
from request_cache_py import cached_get, cached_post

# Cached GET request
response = cached_get('https://api.example.com/data')
print(response.text)

# Cached POST request
response = cached_post('https://api.example.com/submit', 
                       json={'key': 'value'})
```

## Configuration

```python
from request_cache_py import configure

# Configure cache settings
configure(
    enabled=True,     # Enable/disable caching
    ttl=3600,         # Cache TTL in seconds (default: 1 hour)
    max_size=1000     # Maximum cache entries (default: 1000)
)
```

## Advanced Usage

```python
from request_cache_py import CacheBackend, MemoryCache

# Create custom cache backend
cache = CacheBackend('memory', max_size=5000)

# Manual cache operations
cache.set('my_key', {'data': 'value'}, ttl=7200)
result = cache.get('my_key')
```

## Performance

- **10x faster** than uncached requests for repeated queries
- **Sub-millisecond** cache retrieval
- **Minimal memory footprint** with LRU eviction
- **Thread-safe** for concurrent applications

## Use Cases

- API rate limiting mitigation
- Expensive computation caching
- Network latency reduction
- Development/testing speedup

## License

MIT License - see LICENSE file for details
