Skip to main content

Caching support for Async httpx Client. Cloned from https://github.com/kovan/httpx-caching, https://github.com/johtso/httpx-caching

Project description

Caching for HTTPX.

Test Suite

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

http-caching4-0.1.0.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

http_caching4-0.1.0-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

Details for the file http-caching4-0.1.0.tar.gz.

File metadata

  • Download URL: http-caching4-0.1.0.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for http-caching4-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a837593a04f910f87b07ad8308c1debbca2af0419f2d97476f226c53c181a74e
MD5 0dfc7df1a96507c787182e528e8c8249
BLAKE2b-256 9600da5eddf3d8c1107cb2eeb46262093cb0cb56800cc6b41ff47f382d92fe4c

See more details on using hashes here.

File details

Details for the file http_caching4-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: http_caching4-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 28.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for http_caching4-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a85273563b2c0fecd993876244ac9f398c8638747b3dc3be36fec381471633c8
MD5 1b842efc5dafdc2750700c9b018ecec0
BLAKE2b-256 fb2c0e5ffc1bbdbc0273c1d0012d88ff9d1a423b7b3c5e79b03307003511fad8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page