• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

CacheControl.egg-info/H03-May-2022-7253

cachecontrol/H05-Nov-2021-1,381875

PKG-INFOH A D05-Nov-20212.4 KiB7253

README.rstH A D23-Jul-20201.2 KiB4830

setup.cfgH A D05-Nov-2021162 1510

setup.pyH A D03-May-20221.4 KiB4535

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