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.13.tar.gz
(115.1 kB
view details)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | e28ab6c7b57ff53a7f9a6a8431fff021fb7437794ec581884773610bb8ce3f82 |
|
MD5 | 10b6ccb32a1401e7fa89b9ee024f3c7c |
|
BLAKE2b-256 | ebf74954de19224f488678256e605e029aa9ae58d7f1cb46f17430b826892127 |
Provenance
File details
Details for the file CacheControl-0.12.13-py2.py3-none-any.whl
.
File metadata
- Download URL: CacheControl-0.12.13-py2.py3-none-any.whl
- Upload date:
- Size: 21.2 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 | 431fc10c5ab1a1589ce08c05b948abac31c0f76962d5fc9efab9da280c9790aa |
|
MD5 | 1a34506c245d6d22a0f573adc2b548d3 |
|
BLAKE2b-256 | a2abfc647c0069493a904be5519dd03a535a2d49a51e98d5e3cb5d93d332293d |