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

Uploaded Source

Built Distribution

CacheControl-0.12.11-py2.py3-none-any.whl (21.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: CacheControl-0.12.11.tar.gz
  • Upload date:
  • Size: 16.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.10

File hashes

Hashes for CacheControl-0.12.11.tar.gz
Algorithm Hash digest
SHA256 a5b9fcc986b184db101aa280b42ecdcdfc524892596f606858e0b7a8b4d9e144
MD5 d4393117a879bf1b4e2c01e9c5a285a5
BLAKE2b-256 469b34215200b0c2b2229d7be45c1436ca0e8cad3b10de42cfea96983bd70248

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: CacheControl-0.12.11-py2.py3-none-any.whl
  • Upload date:
  • Size: 21.1 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.10

File hashes

Hashes for CacheControl-0.12.11-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2c75d6a8938cb1933c75c50184549ad42728a27e9f6b92fd677c3151aa72555b
MD5 e3751b73fee2e885e497c2cb7a1348a1
BLAKE2b-256 836315ce47ede5b03657e920f3f006e56ca9a16f7873978146f2f77e297bdd22

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