httplib2 caching for requests
Project Links
Meta
Author: Eric Larson, Frost Ming, William Woodruff
Requires Python: >=3.9
Classifiers
Development Status
- 4 - Beta
Environment
- Web Environment
Operating System
- OS Independent
Programming Language
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
Topic
- Internet :: WWW/HTTP
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('https://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
Apr 30, 2025
0.14.3
Jan 07, 2025
0.14.2
Nov 04, 2024
0.14.1
Feb 02, 2024
0.14.0
Jun 08, 2023
0.13.1
Jun 08, 2023
0.13.1rc0
Jun 01, 2023
0.13.0
Jun 06, 2023
0.12.14
Jun 05, 2023
0.12.13
Sep 12, 2022
0.12.12
Apr 19, 2022
0.12.11
Nov 05, 2021
0.12.10
Nov 02, 2021
0.12.9
Oct 29, 2021
0.12.8
Oct 29, 2021
0.12.7
Dec 22, 2019
0.12.6
Jun 07, 2018
0.12.5
Jan 27, 2018
0.12.4
May 25, 2017
0.12.3
Mar 27, 2017
0.12.2
Mar 14, 2017
0.12.1
Jan 30, 2017
0.12.0
Sep 13, 2016
0.11.7
Jan 19, 2016
0.11.6
May 20, 2015
0.11.5
May 16, 2015
0.11.4
May 11, 2015
0.11.3
Mar 19, 2015
0.11.2
Jan 28, 2015
0.11.1
Jan 28, 2015
0.11.0
Dec 18, 2014
0.10.7
Dec 04, 2014
0.10.6
Sep 17, 2014
0.10.4
Sep 10, 2014
0.10.3
Jul 03, 2014
0.10.2
May 08, 2014
0.10.1
Apr 24, 2014
0.10.0
Apr 24, 2014
0.9.4
Mar 13, 2014
0.9.3
Jan 12, 2014
0.9.2
Jan 12, 2014
0.9.1
Jan 12, 2014
0.9.0
Nov 26, 2013
0.8.3
Nov 26, 2013
0.8.2
Nov 26, 2013
0.8.1
Nov 26, 2013
0.8.0
Nov 13, 2013
0.7.3
Nov 08, 2013
0.7.2
Nov 07, 2013
0.7.1
Jun 20, 2013
0.6
Jun 18, 2013
0.5