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

Uploaded Source

Built Distribution

CacheControl-0.12.13-py2.py3-none-any.whl (21.2 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: CacheControl-0.12.13.tar.gz
  • Upload date:
  • Size: 115.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for CacheControl-0.12.13.tar.gz
Algorithm Hash digest
SHA256 e28ab6c7b57ff53a7f9a6a8431fff021fb7437794ec581884773610bb8ce3f82
MD5 10b6ccb32a1401e7fa89b9ee024f3c7c
BLAKE2b-256 ebf74954de19224f488678256e605e029aa9ae58d7f1cb46f17430b826892127

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for CacheControl-0.12.13-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 431fc10c5ab1a1589ce08c05b948abac31c0f76962d5fc9efab9da280c9790aa
MD5 1a34506c245d6d22a0f573adc2b548d3
BLAKE2b-256 a2abfc647c0069493a904be5519dd03a535a2d49a51e98d5e3cb5d93d332293d

See more details on using hashes here.

Provenance

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