NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1823 most downloaded on PyPI
Adds caching support to Flask applications.
Last release 1 months ago
04 Sep 2026
Release timing varies
gaps range from 2 weeks to 1.2 years
Nearly every release is documented
notes for 32 of 32 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
32 releases · first in 2016
This is the Flask-Caching 2.5.1 fix release, which fixes bugs but does not otherwise change behavior and should not result in breaking changes compare…
This is the Flask-Caching 2.5.1 fix release, which fixes bugs but does not otherwise change behavior and should not result in breaking changes compared to the latest feature release.
PyPI: https://pypi.org/project/Flask-Caching/2.5.1/
Changes: https://flask-caching.readthedocs.io/en/latest/changelog/#version-2-5-1
Released 2026-09-04
@cached no longer treats view arguments named path or query_args as the explicit make_cache_key() arguments of the same name. 679
One column per quarter.
Remove the deprecated lowercase CACHE_TYPE names ( null , simple , filesystem , redis , redissentinel , rediscluster , uwsgi , memcached , gaememcache…
Note: This release will invalidate your caches because we changed the default hash_method from hashlib.md5 to hashlib.sha256. This can be changed back via CACHE_HASH_METHOD if you wish to still use the old hash_method!
datetime.timedelta. #266CACHE_SERIALIZER to set the cachelib serializer the backend uses. #209CACHE_TYPE="cachelib.ValkeyCache. #668Cache.delete_cached() and extend make_cache_key() with path and query_args arguments to make deleting views decorated with cached(query_string=True) possible. #243CACHE_HASH_METHOD to set the hash method used for the cache keys of @cached and @memoize.is_stale option to @cached and @memoize. It is called on a cache hit with the cached value. Unlike forced_update it uses the value itself to check whether the cache is stale. Can be used in combination with forced_update #392@cached and @memoize now preserve the wrapped function's signature and expose uncached, cache_timeout, make_cache_key delete_memoized to type checkers.CACHE_FILE_HASH_METHOD config option to FileSystemCache to allow using a different hash function for cache keys. #660pool_size and pool_blocking to make MemcachedCache backends thread-safe. #663CACHE_REDIS_HOST accepts an already created redis.Redis client instead of a host name, which allows sharing a connection pool with other extensions and the application. #629@staticmethod and @classmethod when memoizing. #440SimpleCache docs as it's now thread-safe using an RLock for all operations. #663CACHE_TYPE names (null, simple, filesystem, redis, redissentinel, rediscluster, uwsgi, memcached, gaememcached, saslmemcached and spreadsaslmemcached)hashlib.sha256 instead of hashlib.md5 for hashing the cache keys. This changes the generated keys, so entries cached by an earlier version become obsolete. If you wish to still use hashlib.md5 set the config CACHE_HASH_METHOD = hashlib.md5. #563@cached and @memoize now go through the public Cache proxy methods (get, set, has, delete, delete_many, get_many and set_many) instead of calling the backend directly. #417CACHE_IGNORE_ERRORS is now used by every backend instead of only SimpleCache and FileSystemCache.delete_many method is now used from cachelib. A key that does not exist counts as deleted, and with CACHE_IGNORE_ERRORS set to False a RuntimeError is raised if the key could not be deleted.@memoize forced_update callbacks once per decorated function call instead of once while making the key and again before cache lookup. #387@cached now caches an HTTPException raised by the view (i.e. through abort()). This exception will now be re-raises on a cache hit. Use response_filter, to keep the exception out of the cache. #444{% cache %} Jinja tag no longer propagates backend errors. If the cache is unavailable, the block is rendered normally instead of raising, matching the existing behavior of @memoize. #564 #565key_prefix when building @cached(query_string=True) cache keys. #302@memoize cache-key collision when a parameter has a falsy default (e.g. 0, "", False): calling with the default was keyed the same as passing None, returning the wrong cached result. #656@cached(response_hit_indication=True) appending a new after_request function to the app on every request.flask.stream_template it previously returned a list of JSON strings instead of the rendered template. #511__caching_id__ never being usable. @memoize silently ignored that and ran the function uncached.delete_memoized now takes the instance from a bound method, so cache.delete_memoized(obj.method, 1) deletes the cache for obj.method(1) instead of silently deleting nothing. The current behaviour by passing the instance keeps working as well. #554@memoize invalidating a function's entire cache by not updating the memoize version key's timeout. It is now refreshed each time an entry is written, with that entry's own timeout. #531Full Changelog: v2.4.1...v2.5.0
https://github.com/pallets-eco/flask-caching/blob/v2.4.1/CHANGES.rst
https://github.com/pallets-eco/flask-caching/blob/v2.4.1/CHANGES.rst
Full Changelog: v2.4.0...v2.4.1
https://github.com/pallets-eco/flask-caching/blob/v2.3.1/CHANGES.rst
Full Changelog: https://github.com/pallets-eco/flask-caching/compare/v2.4.0...v2.4.1
Released 2026-07-08
Use pallets_sphinx_themes for the documentation.
Type CachedResponse.__init__ so it doesn't trigger mypy [no-untyped-call] in strict downstream codebases. 628
Docs: clarify that @memoize uses repr(obj) (or __caching_id__) for the self/cls identity, not Python's id. 555
Fix test failure with pytest 9.1. 651
https://github.com/pallets-eco/flask-caching/blob/v2.3.1/CHANGES.rst
Released 2026-04-17
Modernize project setup
Update intersphinx_mapping for Sphinx 8 compatibility. 599, 598
Pass CACHE_OPTIONS as kwargs to redis_from_url. 591
Pass sentinel_kwargs to redis client via CACHE_OPTIONS 626
Fix response_hit_indication return True always. 579, 596, 595, 570
Use FORWARDREF annotation format when introspecting decorated functions so that @memoize / @cached work with TYPE_CHECKING-only annotations on Python 3.14. 636
https://github.com/pallets-eco/flask-caching/blob/v2.3.1/CHANGES.rst
Released 2025-02-22
Relax cachelib version to allow latest releases
https://github.com/pallets-eco/flask-caching/blob/v2.1.0/CHANGES.rst
Released 2024-05-04
Added response_hit_indication flag to Cache.cached decorator for appending 'hit_cache' headers to responses, indicating cache hits.
https://github.com/pallets-eco/flask-caching/blob/v2.1.0/CHANGES.rst
Drop python 3.7 support
python 3.11 officially supported
Fix issue causing args_to_ignore to not work with flask_caching.Cache.memoize decorator when keyword arguments were used in the decorated function call
https://github.com/pallets-eco/flask-caching/blob/v2.1.0/CHANGES.rst
Released 2024-10-08
fix type signature in flask_caching.utils.make_template_fragment_key. 430
Added docs and example for make_cache_key
support Flask 3
https://github.com/pallets-eco/flask-caching/blob/4b522cf488d355690b36a5d5eda02b34d6e80d5f/CHANGES.rst
Released 2023-01-12
fix issue with boto3 dependencie due to latest cachelib released
migrate flask_caching.backends.RedisCluster dependency from redis-py-cluster to redis-py
bug fix: make the make_cache_key attributed of decorated view functions writeable. 431, 97
https://github.com/pallets-eco/flask-caching/blob/4b522cf488d355690b36a5d5eda02b34d6e80d5f/CHANGES.rst
Released 2022-07-30
Relax dependency pin to allow Flask 2.x.x
https://github.com/pallets-eco/flask-caching/blob/4b522cf488d355690b36a5d5eda02b34d6e80d5f/CHANGES.rst
https://github.com/pallets-eco/flask-caching/blob/4b522cf488d355690b36a5d5eda02b34d6e80d5f/CHANGES.rst
Released 2022-06-26
fix bug where flask_caching.backends.RedisSentinelCache.get_many would query wrong host&port combination. 372
Remove flask_caching.backends.FileSystemCache method overrides. It now shares 100% of cachelib.FileSystemCache API and is fully compatible. Functionality relient on implementation details of said overrides from older releases might not work anymore. 369
Add proxy to underlaying has method of cache clients. 356
flask_caching.backends.FileSystemCache now stores timestamps in a universal (non-frammed) way following the lastest version of cachelib.FileSystemCache. The change also reduces overhead from 17 bytes (via previous method using pickle) to 4 bytes (using python's struct). This, however, will break compatibily since older timestamps are serialized with a different strategy.
https://github.com/pallets-eco/flask-caching/blob/4b522cf488d355690b36a5d5eda02b34d6e80d5f/CHANGES.rst
https://github.com/pallets-eco/flask-caching/blob/4b522cf488d355690b36a5d5eda02b34d6e80d5f/CHANGES.rst
Add suport for cached/memoized generators. 286
Released 2022-05-27
Add suport for cached/memoized generators. 286
Add support for Flask 2.0 async. 282
Cachelib is now used as backend. 308
Drop support for python 3.6. 332
Add support for dynamic cache timeouts #296
Fix bug in CACHE_OPTIONS reading for redis in RedisSentinelCache. 343
A GoogleCloudStorageCache backend has been added to the user contributed caching backends. PR #214.
Released on March 17th 2021
GoogleCloudStorageCache backend has been added to the user contributed
caching backends. PR #214.Cache class.> * uwsgicache is not officially maintained anymore and deprecated.
Released on March 4th 2021
DEPRECATION NOTICE
uwsgicache is not officially maintained anymore and deprecated.
Caching backends are now loaded using the full path to the caching backend class. For officially supported caching backends it is sufficient to just specify the name of the backend class. See the documentation for a full list of caching backends: https://flask-caching.readthedocs.io/en/latest/#configuring-flask-caching
In the next major release (2.0), this will be the only supported way.
CACHE_TYPE="flask_caching.contrib.UWSGICache".
In the next major release (2.0), this will be the only supported way.SimpleCache and FileSystemCache for better observability. PR #203.args_to_ignore. PR #201.RedisClusterCache) caching backend. PR #173.default_timeout not being properly passed to its super constructor. PR #187.kwargs not being passed on in function _memoize_make_cache_key. PR #184.cache2 option enabled. PR #176.Released 2021-03-04
Important: The way caching backends are loaded have been refactored. Instead of passing the name of the initialization function one can now use the full path to the caching backend class. For example: CACHE_TYPE="flask_caching.backends.SimpleCache". In the next major release (2.0), this will be the only supported way.
UWSGICache is not officially supported anymore and moved to the user contributed backends.
Switch from Travis-CI to GitHub Actions
Fix add() in RedisCache without a timeout. 218
Fix error in how the FileSystemCache counts the number of files. 210
Type Annotations have been added. 198
Add some basic logging to SimpleCache and FileSystemCache for better observability. 203
Add option in memoize to ignore args 201
Stop marking wheels as Python 2 compatible. 196
Fix default_timeout not being properly passed to its super constructor. 187
Fix kwargs not being passed on in function _memoize_make_cache_key. 184
Add a Redis Cluster Mode caching backend. 173
Do not let PIP install this package on unsupported Python Versions. 179
Fix uWSGI initialization by checking if uWSGI has the 'cache2' option enabled. 176
Documentation updates and fixes.
Added an option to include the functions source code when generating the cache key. PR #156.
Released on June 2nd 2020
simple to
simplecache, null to nullcache and filesystem to
filesystemcache.default_timeout to RedisCache from
RedisSentinelCache.os.replace instead of werkzeug's rename due to Windows raising an
OSError if the dst file already exist.Released 2020-06-02
Add an option to include the functions source code when generating the cache key. 156
Add an feature that allows one to completely control the way how cache keys are generated. For example, one can now implement a function that generates a cache key the based on POST requests. 159
Fix the cache backend naming collisions by renaming them from simple to simplecache, null to nullcache and filesystem to filesystemcache.
Explicitly pass the default_timeout to RedisCache from RedisSentinelCache.
Use os.replace instead of werkzeug's rename due to Windows raising an OSError if the dst file already exist.
Documentation updates and fixes.
*Released on November 24th 2019*
Released on November 24th 2019
Breaking: Dropped support for Python 2
None is a cached value or not. See PR #140 and #141.__caching_id__ rather than __repr__ as an object caching key. PR #123.CACHE_TYPE is set to filesystem but no CACHE_DIR is set.Released 2019-11-24
BREAKING: Removed support for Python 2. Python 3.5 and upwards are supported as of now.
Add option to specify if None is a cached value or not. See 140 and #141
Allow to use __caching_id__ rather than __repr__ as an object caching key. 123
The RedisCache backend now support generating the key_prefix via a callable. 109
Emit a warning if the CACHE_TYPE is set to filesystem but no CACHE_DIR is set.
Fixes Google App Engine Memcache backend. See issue #120 for more details.
Various documentation updates and fixes.
This is the last version supporting Python 2!
Released on May 28th 2019
This is the last version supporting Python 2!
Released 2019-05-28
This is the last version supporting Python 2!
Do not run a cached/memoized function if the cached return value is None. 108
This is the last version supporting Python 2!
Released on April 16th 2019
This is the last version supporting Python 2!
uwsgi.py) in PyPI package. See issue #102 for more details.Released 2019-04-16
Fix introspecting Python 3 functions by using varkw. 101
Remove leftover files (uwsgi.py) in PyPI package. See issue #102 for more details.
A DeprecationWarning got turned into a TypeError.
Released on March 29th 2019
This is the last version supporting Python 2!
response_filter which enables one to only
cache views depending on the response code. PR #99.Released 2019-03-29
Added a feature called 'response_filter' which enables one to only cache views depending on the response code. 99
A DeprecationWarning got turned into a TypeError.
The delete_many function is now able to ignore any errors and continue deleting the cache. However, in order to preserve backwards compatibility, the
Released on March 6th 2019
delete_many function is now able to ignore any errors and continue
deleting the cache. However, in order to preserve backwards compatibility,
the default mode is to abort the deletion process. In order to use the new
deletion mode, one has to flip the config setting CACHE_IGNORE_ERRORS to
True. This was and still is only relevant for the filesystem and
simple cache backends. PR #94.gaememcached CACHE_TYPE for improved backwards compatibility.Include the deprecated werkzeug.contrib.cache module in Flask-Caching. PR #75.
Released on February 23rd 2019
werkzeug.contrib.cache module in Flask-Caching. PR #75.Released 2019-02-23
Add support for a Redis Sentinel Cluster. 90
Parameterize the hash function so alternatives can be used. 77
Include the deprecated werkzeug.contrib.cache module in Flask-Caching. 75
Fix logic for creating key for var args in memoize. PR #70.
Released on April 16th 2018
Released 2018-04-16
Fix logic for creating key for var args in memoize. 70
Allow older Werkzeug versions by making the UWSGICache backend conditional. 55
Some documentation improvements. 48, #51, #56, #67
Some CI improvements. 49, #50
Add support for multiple query params and use md5 for consistent hashing. PR #43.
Released on October 5th 2017
Released 2017-06-25
Add support for multiple query params and use md5 for consistent hashing. 43
Fix spreadsaslmemcached backend when using Python 3.
Released on June 25th 2017
spreadsaslmemcached backend when using Python 3.Released 2017-06-25
Fix spreadsaslmemcached backend when using Python 3.
Fix kwargs order when memoizing a function using Python 3.6 or greater. See #27
Avoid breakage for environments with Werkzeug<0.12 installed because the uwsgi backend depends on Werkzeug >=0.12
Released on June 20th 2017
Released 2017-06-20
Avoid breakage for environments with Werkzeug<0.12 installed because the uwsgi backend depends on Werkzeug >=0.12. See #38
Add uWSGI Caching backend (requires Werkzeug >= 0.12)
Released on June 17th 2017
query_string to the cached decorator in order to create
the same cache key for different query string requests,
so long as they have the same key/value (order does not matter).
PR #35.Allows functions with kwargs to be memoized correctly. See #18
Released 2017-02-02
Allows functions with kwargs to be memoized correctly. See #18
Fix PyPI Package distribution. See #15
Released 2016-12-09
Fix PyPI Package distribution. See #15
Fix 'redis' backend import mechanisim. See #14
Released 2016-12-09
Fix 'redis' backend import mechanisim. See #14
Made backends a module to better control which cache backends to expose and moved our custom clients into a own module inside of the backends module. See also #14 (and partly some own changes).
Some docs and test changes. See #8 and #12
The caching wrappers like add, set, etc are now returning the wrapped result as someone would expect. See #5
Released 2016-08-30
The caching wrappers like add, set, etc are now returning the wrapped result as someone would expect. See #5
Have a look at Flask's documentation for more information regarding this matter. This also fixes the deprecation warning from Flask.
First release since 2013.
flask.ext.cache),
the name of the extension, flask_cache is used. Have a look at
Flask's documentation
for more information regarding this matter. This also fixes the
deprecation warning from Flask.flask_caching) as it will now be
available on PyPI for download.In addition to the above mentioned fixes, following pull requests have been merged into this fork of Flask-Cache:
Your coding agent can read these notes before it upgrades. Set up the MCP server →