skillfed

CacheControl

httplib2 caching for requests

cachecontrol Permissive license Apache-2.0 Active 502 v0.14.4 released

Install

cachecontrol on PyPI

pip

pip install cachecontrol

uv

uv add cachecontrol

poetry

poetry add cachecontrol

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — requests, msgpack
Maintenance actively maintained — 272 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: cachecontrol-0.14.4-py3-none-any.whl

Keywords: requests, http, caching, web

Development Status :: 4 - BetaEnvironment :: Web EnvironmentOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTP

About CacheControl

from the package's own PyPI description — quoted content, verbatim

.. SPDX-FileCopyrightText: SPDX-FileCopyrightText: 2015 Eric Larson

SPDX-License-Identifier: Apache-2.0

============== CacheControl ==============

.. image:: https://img.shields.io/pypi/v/cachecontrol.svg :target: https://pypi.python.org/pypi/cachecontrol :alt: Latest Version

.. image:: https://github.com/psf/cachecontrol/actions/workflows/tests.yml/badge.svg :target: https://github.com/psf/cachecontrol/actions/workflows/tests.yml

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

.. code-block:: python

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_

.. _docs: http://cachecontrol.readthedocs.org/en/latest/ .. _httplib2: https://github.com/httplib2/httplib2 .....

Read as markdown · JSON record · Source repository · Homepage

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

CacheControl adds HTTP caching support to the requests library, implementing httplib2's caching algorithms with thread-safe operation for requests session objects.

Low friction install with just two runtime dependencies (requests and msgpack). Repository is actively maintained with recent commits and no known vulnerabilities.

Apache-2.0 permissive license allows use in most commercial and open-source projects without significant restrictions.

Usage

import requests
from cachecontrol import CacheControl

sess = requests.session()
cached_sess = CacheControl(sess)
response = cached_sess.get('https://example.com')

Requires Python 3.10 or later.

Verdict: CacheControl is a lightweight, actively maintained caching layer for requests with no known vulnerabilities and permissive licensing. It's well-suited for applications needing transparent HTTP caching with thread safety.

Needs verification

  • Whether msgpack is an optional or required runtime dependency for all use cases
  • Performance overhead compared to uncached requests in typical workloads
  • Thread-safety guarantees under concurrent access patterns
http caching for requestsrequests session cachinghttplib2 caching algorithmscache control headersthread-safe http cacherequests response cachingweb request caching

Similar packages