httpx-caching 0.1a4

Last updated:

0 purchases

httpx-caching 0.1a4 Image
httpx-caching 0.1a4 Images
Add to Cart

Description:

httpxcaching 0.1a4

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.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.