MyGit

johtso/httpx-caching

Fork: 6 Star: 67 (更新于 2024-11-09 12:06:07)

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-11-22 19:26:55 ultralytics/ultralytics

2024-11-22 08:12:43 jxxghp/MoviePilot

2024-11-22 02:39:01 goauthentik/authentik

2024-11-22 00:15:39 jumpserver/jumpserver

2024-11-22 00:03:47 comfyanonymous/ComfyUI

2024-11-21 22:06:18 rashevskyv/dbi