requests-cache
A persistent cache for python requests
Decision gist · record as of 2026-08-14
Yes. requests-cache is production-stable, actively maintained, has no known vulnerabilities, and adds caching to requests with minimal friction. Install it if you make repeated HTTP requests, need to respect rate limits, or want to speed up development workflows. The permissive BSD-2-Clause license poses no restrictions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with a pure-Python wheel.
- Active maintenance with a recent release 42 days ago and ongoing commits.
- Depends on six common, stable packages: attrs, cattrs, platformdirs, requests, url-normalize, and urllib3.
License · maintenance · safety
BSD-2-Clause (permissive) — BSD-2-Clause is permissive; you can use this package freely in commercial and private projects with minimal restrictions.
last release 2026-07-03 (42 days) · last repo commit 2026-08-09 · 1,502 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 21,000,366 downloads/mo, #1,019 on PyPI
Alternatives
Verify before relying
pip install requests-cache
import requests_cache
session = requests_cache.CachedSession('demo_cache')
response = session.get('https://example.com/api')- Whether all storage backends (SQLite, Redis, MongoDB, DynamoDB) are included by default or require optional dependencies.
- Performance characteristics of conditional requests and how much time savings they provide relative to full cache misses.
- Compatibility scope with requests-based libraries beyond what the description mentions.
What it is and what it does
requests-cache wraps the requests library to transparently cache HTTP responses, eliminating redundant network calls. It acts as a drop-in replacement for requests.Session or can be installed globally to patch all requests functions without code changes. Responses are stored persistently across program runs using configurable backends (SQLite by default, or Redis, MongoDB, DynamoDB, JSON, YAML, etc.) and can expire based on fixed time intervals, HTTP Cache-Control headers, or custom schedules. The library is designed for minimal setup—zero configuration works out of the box—but offers extensive customization for matching strategies, conditional requests, and cache invalidation.
Typical use cases include reducing load on rate-limited APIs, speeding up repeated requests during development or testing, and improving performance in web scraping and data collection workflows. The package supports modern Python versions and is production-stable with no known vulnerabilities.
Use it for
- Speed up repeated API calls during development or testing by caching responses locally instead of hitting the server each time.
- Reduce load on rate-limited APIs by reusing cached responses within expiration windows, avoiding unnecessary network requests.
- Build resilient scrapers that can serve stale cached data if a request fails, improving reliability in unstable network conditions.
- Cache responses with different expiration strategies per endpoint using Cache-Control headers or custom schedules.
- Store HTTP responses persistently across program runs in SQLite, Redis, or other backends for long-term reuse.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
requests-cache is production-stable, actively maintained, has no known vulnerabilities, and adds caching to requests with minimal friction. Install it if you make repeated HTTP requests, need to respect rate limits, or want to speed up development workflows. The permissive BSD-2-Clause license poses no restrictions.
Install
requests-cache on PyPI
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a recent release 42 days ago and ongoing commits. Depends on six common, stable packages: attrs, cattrs, platformdirs, requests, url-normalize, and urllib3.
License in practice
BSD-2-Clause is permissive; you can use this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install requests-cache
import requests_cache
session = requests_cache.CachedSession('demo_cache')
response = session.get('https://example.com/api')
Verify before relying
- Whether all storage backends (SQLite, Redis, MongoDB, DynamoDB) are included by default or require optional dependencies.
- Performance characteristics of conditional requests and how much time savings they provide relative to full cache misses.
- Compatibility scope with requests-based libraries beyond what the description mentions.
Package facts
| License | BSD-2-Clause permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagesattrscattrsplatformdirsrequestsurl-normalizeurllib3 |
| Maintenance | Actively maintained 42 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 21,000,366 / month, #1,019 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: requests_cache-1.3.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “persistent requests cache”
- requests-cacheAdds persistent HTTP caching to the requests library, allowing cached…
- lmcacheLMCache is a KV cache management layer that stores, reuses, and…
- aiohttp-client-cacheAdds transparent request caching to aiohttp.ClientSession, storing…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also aiohttp-client-cache · CacheControl · fastapi-cache2 · acachecontrol · Beaker · flexcache · httplib2 · py-memoize · cached-path · hishel