httplib2 caching for requests
Project description
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
Release history Release notifications | RSS feed
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)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1087f45781c0e00616479bfd282c78504371ca71da017b49df9f5365a95feba |
|
MD5 | 9f5c7d8ae48f49ff27363f2a4d3e77b1 |
|
BLAKE2b-256 | 5043bfdc1888b1889bdb6eaadc179f6d18a0aa34d53eb89fb5954e09bc37b7e1 |
Provenance
File details
Details for the file CacheControl-0.12.14-py2.py3-none-any.whl
.
File metadata
- Download URL: CacheControl-0.12.14-py2.py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c2939be362a70c4e5f02c6249462b3b7a24441e4f1ced5e9ef028172edf356a |
|
MD5 | d0a529c668f63b315eb962ee8ca55f92 |
|
BLAKE2b-256 | 72a228e0ef082f7d78253aded97933e1d7b94bab3c5be366e8afd6513de4028e |