MyGit

johtso/httpx-caching

Fork: 6 Star: 67 (更新于 2024-12-02 04:06:03)

license: 暂无

Language: Python .

Caching for HTTPX

最后发布版本: v0.1a2 ( 2022-03-19 05:55:04)

GitHub网址

Caching for HTTPX.

Test Suite Package version

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.

最近版本更新:(数据更新于 2024-09-30 14:49:41)

2022-03-19 05:55:04 v0.1a2

2022-03-19 05:19:17 v0.1a1

johtso/httpx-caching同语言 Python最近更新仓库

2024-12-22 18:18:34 LeslieLeung/heimdallr

2024-12-22 09:03:32 ultralytics/ultralytics

2024-12-21 13:26:40 notepad-plus-plus/nppPluginList

2024-12-21 11:42:53 XiaoMi/ha_xiaomi_home

2024-12-21 04:33:22 comfyanonymous/ComfyUI

2024-12-20 18:47:56 home-assistant/core