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 threadsafety. 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.5.tar.gz (14.4 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: CacheControl-0.12.5.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for CacheControl-0.12.5.tar.gz
Algorithm Hash digest
SHA256 cef77effdf51b43178f6a2d3b787e3734f98ade253fa3187f3bb7315aaa42ff7
MD5 f1baef403e8dd68c5a203e2eb23a0f2e
BLAKE2b-256 5ef02c193ed1f17c97ae539da7e1c2d48b80d8cccb1917163b26a91ca4355aa6

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