Skip to main content

httplib2 caching for requests

Project description

Latest Version https://travis-ci.org/ionrock/cachecontrol.png?branch=master

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.12.9.tar.gz (15.6 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.12.9-py2.py3-none-any.whl (23.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file CacheControl-0.12.9.tar.gz.

File metadata

  • Download URL: CacheControl-0.12.9.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for CacheControl-0.12.9.tar.gz
Algorithm Hash digest
SHA256 b5d0c98f7ee9f02e2d5a85af98b9a76c0a2c73c972c142291f823a0ed2eb7a78
MD5 31c379f2243828bffb80dea8a0f2fa4b
BLAKE2b-256 ffba57ab4d88e0f32e41a4682d1c8b8798c7a89aa7b54a000b2043d443e0260e

See more details on using hashes here.

File details

Details for the file CacheControl-0.12.9-py2.py3-none-any.whl.

File metadata

  • Download URL: CacheControl-0.12.9-py2.py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for CacheControl-0.12.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1675f6b0ed902b419f60af4f1d33486e2379743e3723c594eca2f95b10e4370a
MD5 00fc8e1ec157e9ae56b366fe69164ab8
BLAKE2b-256 216620f741c1f2e0df071eca4ed13499622d5771897f22e2eb412c19a9880e0d

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