Flask-Caching
Adds caching support to Flask applications.
Decision gist · record as of 2026-08-14
Yes. Flask-Caching is a mature, actively maintained package with low install friction, no security issues, and a permissive license. It's the standard way to add caching to Flask applications and is backed by the Pallets organization. Install it if you need to cache view functions, templates, or arbitrary data in a Flask app.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction install with only two runtime dependencies (flask and cachelib).
- The project is actively maintained under the Pallets Community Ecosystem with a recent release and ongoing repository activity.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is a permissive license; you can use this package freely in commercial and private projects with minimal restrictions, provided you include the license text.
last release 2026-07-08 (37 days) · last repo commit 2026-08-13 · 934 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 10,050,421 downloads/mo, #1,489 on PyPI
Alternatives
Verify before relying
pip install flask-caching
from flask import Flask
from flask_caching import Cache
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
@app.route('/data')
@cache.cached()
def get_data():
return {'result': 'cached'}
- Whether all advertised cache backends (Redis, Memcached, filesystem, etc.) are included or require separate installation.
- Performance characteristics and cache hit/miss overhead compared to direct backend usage.
- Default cache timeout values and expiration behavior for decorated functions.
What it is and what it does
Flask-Caching is a community-maintained fork of Flask-Cache that provides a decorator-based caching layer for Flask applications. It sits between your Flask routes and view logic, allowing you to cache expensive computations, database queries, or entire HTTP responses with minimal code changes. The package abstracts away the complexity of managing different cache backends—you configure a backend (simple in-memory, Redis, Memcached, filesystem, or others) once, then use decorators to mark functions for caching.
The package depends only on flask and cachelib, keeping the install footprint small. It's actively maintained by the Pallets Community Ecosystem (the organization behind Flask itself), with recent releases and no known security vulnerabilities. It supports current Python versions (3.10+) and is classified as production-stable.
Use it for
- Cache expensive database queries in view functions to reduce load and improve response times.
- Cache rendered templates or partial HTML fragments to avoid re-rendering on every request.
- Memoize the results of slow computations or API calls with automatic expiration.
- Implement request-level or application-level caching strategies without writing backend-specific code.
- Add cache invalidation logic to clear cached data when underlying data changes.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Flask-Caching is a mature, actively maintained package with low install friction, no security issues, and a permissive license. It's the standard way to add caching to Flask applications and is backed by the Pallets organization. Install it if you need to cache view functions, templates, or arbitrary data in a Flask app.
Install
flask-caching on PyPI
Before you install
Low friction install with only two runtime dependencies (flask and cachelib). The project is actively maintained under the Pallets Community Ecosystem with a recent release and ongoing repository activity.
Requires Python 3.10 or later.
License in practice
BSD-3-Clause is a permissive license; you can use this package freely in commercial and private projects with minimal restrictions, provided you include the license text.
Quickstart
pip install flask-caching
from flask import Flask
from flask_caching import Cache
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
@app.route('/data')
@cache.cached()
def get_data():
return {'result': 'cached'}
Verify before relying
- Whether all advertised cache backends (Redis, Memcached, filesystem, etc.) are included or require separate installation.
- Performance characteristics and cache hit/miss overhead compared to direct backend usage.
- Default cache timeout values and expiration behavior for decorated functions.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesflaskcachelib |
| Maintenance | Actively maintained 37 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 10,050,421 / month, #1,489 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/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python |
Evidence: flask_caching-2.4.1-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 › “flask caching decorator”
- Flask-CachingFlask-Caching adds caching support to Flask applications, allowing…
- Flask-CompressFlask-Compress automatically compresses Flask application responses…
- Flask-HTTPAuthAdds HTTP Basic, Digest, and Token authentication decorators to Flask…
Give your agent the search over MCP, or paste the wish link into any chat.
More Dynamic Content packages
MarkupSafe provides a text object that escapes special characters so untrusted strings can be safely embedded in HTML and XML without injection attacks.
Jinja2 is a templating engine that renders dynamic content by combining templates with Python-like syntax and data, supporting template inheritance, macros, autoescaping, and sandboxed execution.
Soupsieve is a CSS selector library designed to work with Beautiful Soup 4 to select, match, and filter HTML and XML elements using modern CSS selectors from CSS level 1 through CSS level 4 specifications.
Install it if you use Beautiful Soup for HTML or XML parsing and want modern CSS selector support.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
Flask is a lightweight WSGI web application framework for building web applications in Python, from simple single-page sites to complex multi-route applications.
Mako compiles Python-embedded templates into Python modules for fast rendering, supporting layout inheritance, custom functions, and direct Python expressions within template syntax.
See also Flask-Admin · Flask-Mail · Flask-Security · cachelib · Flask-Session · Pallets-Sphinx-Themes · Flask-Pydantic · Flask-API · Flask-Compress · Flask-Injector