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.1.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

cachecontrol-0.14.1-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cachecontrol-0.14.1.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cachecontrol-0.14.1.tar.gz
Algorithm Hash digest
SHA256 06ef916a1e4eb7dba9948cdfc9c76e749db2e02104a9a1277e8b642591a0f717
MD5 a4d0596a36c2601a1ea72cfcad5de87a
BLAKE2b-256 d223db12e0b6b241e33f77f7cce01a06b4cc6f8071728656cc0ea262d2a14dad

See more details on using hashes here.

Provenance

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

Publisher: release.yml on psf/cachecontrol

Attestations:

File details

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

File metadata

File hashes

Hashes for cachecontrol-0.14.1-py3-none-any.whl
Algorithm Hash digest
SHA256 65e3abd62b06382ce3894df60dde9e0deb92aeb734724f68fa4f3b91e97206b9
MD5 c00823864344174ad2f3c951eab12f60
BLAKE2b-256 f1aa481eb52af52aae093c61c181f2308779973ffd6f0f5f6c0881b2138f3087

See more details on using hashes here.

Provenance

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

Publisher: release.yml on psf/cachecontrol

Attestations:

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