johtso/httpx-caching
Fork: 6 Star: 69 (更新于 2025-01-03 18:40:11)
license: 暂无
Language: Python .
Caching for HTTPX
最后发布版本: v0.1a2 ( 2022-03-19 05:55:04)
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.
johtso/httpx-caching同语言 Python最近更新仓库
2025-01-18 21:26:31 sunnypilot/sunnypilot
2025-01-17 23:34:10 Skyvern-AI/skyvern
2025-01-17 19:49:33 ultralytics/ultralytics
2025-01-17 19:12:03 XiaoMi/ha_xiaomi_home
2025-01-17 08:27:45 comfyanonymous/ComfyUI
2025-01-17 04:56:19 QuivrHQ/MegaParse