Caching for HTTPX.
Project description
Caching for HTTPX.
Note: Early development / alpha, use at your own risk.
This package adds caching functionality to HTTPX
Adapted from Eric Larson's fantastic CacheControl for requests.
Project goals:
- Sans-io caching protocol
- Fully async compatible
- Support multiple http clients (currently only supports httpx)
Limitations:
- Currently only has in-memory cache storage (async redis would be nice!)
- Test suite was taken wholesale from CacheControl, so still uses a test server and mocking rather than taking advantage of the sans-io implementation.
Usage:
import asyncio
from httpx import AsyncClient
from httpx_caching import CachingClient
client = AsyncClient()
client = CachingClient(client)
async def run_example():
await client.get("http://example.com")
loop = asyncio.get_event_loop()
loop.run_until_complete(run_example())
Documentation:
TODO
See CacheControl's documentation for general documentation of the caching approach.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
httpx-caching-0.1a3.tar.gz
(15.2 kB
view hashes)
Built Distribution
Close
Hashes for httpx_caching-0.1a3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2f0b6e1df3a94583ca13345d12b3f5c1d4219354d63f0bc0671207c76bf4b6b |
|
MD5 | 23f0f3960c37036bc017a192188451c8 |
|
BLAKE2b-256 | f7e8012f2d254195f7cd055c0dae5f7849b6431fc4c3bb0dda2f56cf21d94dee |