Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
CacheControl.egg-info/ | H | 03-May-2022 | - | 72 | 53 | |
cachecontrol/ | H | 05-Nov-2021 | - | 1,381 | 875 | |
PKG-INFO | H A D | 05-Nov-2021 | 2.4 KiB | 72 | 53 | |
README.rst | H A D | 23-Jul-2020 | 1.2 KiB | 48 | 30 | |
setup.cfg | H A D | 05-Nov-2021 | 162 | 15 | 10 | |
setup.py | H A D | 03-May-2022 | 1.4 KiB | 45 | 35 |
README.rst
1.. 2 SPDX-FileCopyrightText: SPDX-FileCopyrightText: 2015 Eric Larson 3 4 SPDX-License-Identifier: Apache-2.0 5 6============== 7 CacheControl 8============== 9 10.. image:: https://img.shields.io/pypi/v/cachecontrol.svg 11 :target: https://pypi.python.org/pypi/cachecontrol 12 :alt: Latest Version 13 14.. image:: https://travis-ci.org/ionrock/cachecontrol.png?branch=master 15 :target: https://travis-ci.org/ionrock/cachecontrol 16 17CacheControl is a port of the caching algorithms in httplib2_ for use with 18requests_ session object. 19 20It was written because httplib2's better support for caching is often 21mitigated by its lack of thread safety. The same is true of requests in 22terms of caching. 23 24 25Quickstart 26========== 27 28.. code-block:: python 29 30 import requests 31 32 from cachecontrol import CacheControl 33 34 35 sess = requests.session() 36 cached_sess = CacheControl(sess) 37 38 response = cached_sess.get('http://google.com') 39 40If the URL contains any caching based headers, it will cache the 41result in a simple dictionary. 42 43For more info, check out the docs_ 44 45.. _docs: http://cachecontrol.readthedocs.org/en/latest/ 46.. _httplib2: https://github.com/httplib2/httplib2 47.. _requests: http://docs.python-requests.org/ 48