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

Uploaded Source

Built Distribution

CacheControl-0.12.14-py2.py3-none-any.whl (21.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: CacheControl-0.12.14.tar.gz
  • Upload date:
  • Size: 115.4 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.14.tar.gz
Algorithm Hash digest
SHA256 d1087f45781c0e00616479bfd282c78504371ca71da017b49df9f5365a95feba
MD5 9f5c7d8ae48f49ff27363f2a4d3e77b1
BLAKE2b-256 5043bfdc1888b1889bdb6eaadc179f6d18a0aa34d53eb89fb5954e09bc37b7e1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for CacheControl-0.12.14-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1c2939be362a70c4e5f02c6249462b3b7a24441e4f1ced5e9ef028172edf356a
MD5 d0a529c668f63b315eb962ee8ca55f92
BLAKE2b-256 72a228e0ef082f7d78253aded97933e1d7b94bab3c5be366e8afd6513de4028e

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