Skip to main content

Caching for HTTPX.

Project description

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.

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

httpx-caching-0.1a4.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

httpx_caching-0.1a4-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file httpx-caching-0.1a4.tar.gz.

File metadata

  • Download URL: httpx-caching-0.1a4.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/7.1.0 pkginfo/1.10.0 requests/2.31.0 requests-toolbelt/1.0.0 tqdm/4.66.4 CPython/3.9.19

File hashes

Hashes for httpx-caching-0.1a4.tar.gz
Algorithm Hash digest
SHA256 8b7ed1f9d163f221b3cf88a8bb60b3a567028a7471a5618512c0ed4aefd96065
MD5 83364a4db6d26f06823b38807129d52e
BLAKE2b-256 d2e692ce0d1918b55753bf75fd89d1cb6dc815073703442be59600b1da272441

See more details on using hashes here.

File details

Details for the file httpx_caching-0.1a4-py3-none-any.whl.

File metadata

  • Download URL: httpx_caching-0.1a4-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/7.1.0 pkginfo/1.10.0 requests/2.31.0 requests-toolbelt/1.0.0 tqdm/4.66.4 CPython/3.9.19

File hashes

Hashes for httpx_caching-0.1a4-py3-none-any.whl
Algorithm Hash digest
SHA256 1ff823b930eb4b7dbd56e411a0aa5f00161ca90e5a5a130d814358bf742fa193
MD5 1aa5751a6f36ae603de38ca04c03c03e
BLAKE2b-256 030c9b4e1ef83fbea951d5b2bbc678c4ea890de171dc37545759e6350c600c77

See more details on using hashes here.

Supported by

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