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

Uploaded Source

Built Distribution

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

cachecontrol-0.14.4-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cachecontrol-0.14.4.tar.gz
Algorithm Hash digest
SHA256 e6220afafa4c22a47dd0badb319f84475d79108100d04e26e8542ef7d3ab05a1
MD5 37d8306a667facb1adc47a159a3733ce
BLAKE2b-256 2df6c972b32d80760fb79d6b9eeb0b3010a46b89c0b23cf6329417ff7886cd22

See more details on using hashes here.

Provenance

The following attestation bundles were made for cachecontrol-0.14.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: cachecontrol-0.14.4-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cachecontrol-0.14.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b7ac014ff72ee199b5f8af1de29d60239954f223e948196fa3d84adaffc71d2b
MD5 bddb71382f42fb8710d434bf9fd0bbbf
BLAKE2b-256 ef79c45f2d53efe6ada1110cf6f9fca095e4ff47a0454444aefdde6ac4789179

See more details on using hashes here.

Provenance

The following attestation bundles were made for cachecontrol-0.14.4-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 Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page