Skip to main content

httplib2 caching for requests

Project description

Latest Version https://github.com/psf/cachecontrol/actions/workflows/tests.yml/badge.svg

CacheControl is a port of the caching algorithms in httplib2 for use with requests session object.

It was written because httplib2’s better support for caching is often mitigated by its lack of thread safety. The same is true of requests in terms of caching.

Quickstart

import requests

from cachecontrol import CacheControl


sess = requests.session()
cached_sess = CacheControl(sess)

response = cached_sess.get('https://google.com')

If the URL contains any caching based headers, it will cache the result in a simple dictionary.

For more info, check out the docs

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

cachecontrol-0.14.3.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

cachecontrol-0.14.3-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file cachecontrol-0.14.3.tar.gz.

File metadata

  • Download URL: cachecontrol-0.14.3.tar.gz
  • Upload date:
  • Size: 29.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cachecontrol-0.14.3.tar.gz
Algorithm Hash digest
SHA256 73e7efec4b06b20d9267b441c1f733664f989fb8688391b670ca812d70795d11
MD5 13bb06e799622ac80ec3af936ed75de3
BLAKE2b-256 583a0cbeb04ea57d2493f3ec5a069a117ab467f85e4a10017c6d854ddcbff104

See more details on using hashes here.

Provenance

The following attestation bundles were made for cachecontrol-0.14.3.tar.gz:

Publisher: release.yml on psf/cachecontrol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cachecontrol-0.14.3-py3-none-any.whl.

File metadata

File hashes

Hashes for cachecontrol-0.14.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b35e44a3113f17d2a31c1e6b27b9de6d4405f84ae51baa8c1d3cc5b633010cae
MD5 c84cf8d86869897e21908b101b79e0ff
BLAKE2b-256 814c800b0607b00b3fd20f1087f80ab53d6b4d005515b0f773e4831e37cfa83f

See more details on using hashes here.

Provenance

The following attestation bundles were made for cachecontrol-0.14.3-py3-none-any.whl:

Publisher: release.yml on psf/cachecontrol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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