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

Uploaded Source

Built Distribution

CacheControl-0.12.6-py2.py3-none-any.whl (19.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: CacheControl-0.12.6.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5

File hashes

Hashes for CacheControl-0.12.6.tar.gz
Algorithm Hash digest
SHA256 be9aa45477a134aee56c8fac518627e1154df063e85f67d4f83ce0ccc23688e8
MD5 5890b797f9b48b2b4cd1448cca89e396
BLAKE2b-256 44b99a1d4349824ae14de4052e84802a0c372fff1fd2bd6668f7e9efe91ac11d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: CacheControl-0.12.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5

File hashes

Hashes for CacheControl-0.12.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 10d056fa27f8563a271b345207402a6dcce8efab7e5b377e270329c62471b10d
MD5 6f9d9a259daa90c8c358ee2388b12d31
BLAKE2b-256 18710a9df4206a5dc5ae7609c41efddab2270a2c1ff61d39de7591dc7302ef89

See more details on using hashes here.

Supported by

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