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('http://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.13.1rc0.tar.gz (29.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.13.1rc0-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file cachecontrol-0.13.1rc0.tar.gz.

File metadata

  • Download URL: cachecontrol-0.13.1rc0.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for cachecontrol-0.13.1rc0.tar.gz
Algorithm Hash digest
SHA256 b7602eb33079496f3f86a24201056d28d58091ca8c1d89b4d3478764392dfd9c
MD5 3cb7d7f204346e38219283ee29a34545
BLAKE2b-256 89a4d8107fd32f5f25a9cf943ff6835e76cbbe99654b63a316118740a6a3c865

See more details on using hashes here.

File details

Details for the file cachecontrol-0.13.1rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for cachecontrol-0.13.1rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ae4d63c02199286b41ec36b1acf16c69331aaaafbeb122b91db9808219b6837
MD5 68bf92c889afa969956cfe593ebea26a
BLAKE2b-256 6139164a7c1ebf7e08e662d7b6ba448c61715f7cdf1256e84a0cdf7facc8597d

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