Debian Codegraph @

CHANGES.rst

raw
1 Changelog
2 =========
3
4 Version 2.4.1
5 -------------
6
7 Released 2026-07-08
8
9 - Use ``pallets_sphinx_themes`` for the documentation.
10 - Type ``CachedResponse.__init__`` so it doesn't trigger mypy ``[no-untyped-call]``
11 in strict downstream codebases. :issue:`628`
12 - Docs: clarify that ``@memoize`` uses ``repr(obj)``
13 (or ``__caching_id__``) for the ``self``/``cls`` identity, not Python's
14 :func:`id`. :issue:`555`
15 - Fix test failure with pytest 9.1. :issue:`651`
16
17
18 Version 2.4.0
19 -------------
20
21 Released 2026-04-17
22
23 - Modernize project setup
24 - Update ``intersphinx_mapping`` for Sphinx 8 compatibility. :pr:`599`, :issue:`598`
25 - Pass CACHE_OPTIONS as kwargs to redis_from_url. :pr:`591`
26 - Pass sentinel_kwargs to redis client via CACHE_OPTIONS :pr:`626`
27 - Fix ``response_hit_indication`` return True always. :pr:`579`, :pr:`596`, :issue:`595`, :issue:`570`
28 - Use ``FORWARDREF`` annotation format when introspecting decorated
29 functions so that ``@memoize`` / ``@cached`` work with
30 ``TYPE_CHECKING``-only annotations on Python 3.14. :issue:`636`
31
32
33 Version 2.3.1
34 -------------
35
36 Released 2025-02-22
37
38 - Relax cachelib version to allow latest releases
39
40
41 Version 2.3.0
42 -------------
43
44 Released 2024-05-04
45
46 - Added ``response_hit_indication`` flag to ``Cache.cached`` decorator for appending 'hit_cache' headers to responses, indicating cache hits.
47
48
49 Version 2.2.0
50 -------------
51
52 - Drop python 3.7 support
53 - python 3.11 officially supported
54 - 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
55
56
57 Version 2.1.0
58 -------------
59
60 Released 2024-10-08
61
62 - fix type signature in ``flask_caching.utils.make_template_fragment_key``. :pr:`430`
63 - Added docs and example for make_cache_key
64 - support Flask 3
65
66
67 Version 2.0.2
68 -------------
69
70 Released 2023-01-12
71
72 - fix issue with boto3 dependencie due to latest cachelib released
73 - migrate ``flask_caching.backends.RedisCluster`` dependency from redis-py-cluster to redis-py
74 - bug fix: make the ``make_cache_key`` attributed of decorated view functions writeable. :pr:`431`, :issue:`97`
75
76
77 Version 2.0.1
78 -------------
79
80 Released 2022-07-30
81
82 - Relax dependency pin to allow Flask 2.x.x
83
84
85 Version 2.0.0
86 -------------
87
88 Released 2022-06-26
89
90 - fix bug where ``flask_caching.backends.RedisSentinelCache.get_many`` would query wrong host&port combination. :pr:`372`
91 - 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. :pr:`369`
92 - Add proxy to underlaying ``has`` method of cache clients. :pr:`356`
93 - ``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.
94
95
96 Version 1.11.1
97 --------------
98
99 Released 2022-05-27
100
101 - Add cachelib to setup.py: :pr:`354`
102
103
104 Version 1.11.0
105 --------------
106
107 Released 2022-05-27
108
109 - Add suport for cached/memoized generators. :pr:`286`
110 - Add support for Flask 2.0 async. :pr:`282`
111 - Cachelib is now used as backend. :pr:`308`
112 - Drop support for python 3.6. :pr:`332`
113 - Add support for dynamic cache timeouts `#296`
114 - Fix bug in ``CACHE_OPTIONS`` reading for redis in ``RedisSentinelCache``. :pr:`343`
115
116
117 Version 1.10.1
118 --------------
119
120 Released 2021-03-17
121
122 - A ``GoogleCloudStorageCache`` backend has been added to the user contributed
123 caching backends. :pr:`214`
124 - Fix a regression introduced in the last release which broke all applications
125 subclassing the ``Cache`` class.
126 - Add test_generic_get_bytes test case.
127 :pr:`236`
128 - Various improvements and fixes.
129
130
131 Version 1.10.0
132 --------------
133
134 Released 2021-03-04
135
136 - **Important**: The way caching backends are loaded have been refactored.
137 Instead of passing the name of the initialization function one can now use
138 the full path to the caching backend class.
139 For example:
140 ``CACHE_TYPE="flask_caching.backends.SimpleCache"``.
141 In the next major release (2.0), this will be the only supported way.
142 - UWSGICache is not officially supported anymore and moved to the user
143 contributed backends.
144 - Switch from Travis-CI to GitHub Actions
145 - Fix add() in RedisCache without a timeout.
146 :pr:`218`
147 - Fix error in how the FileSystemCache counts the number of files.
148 :pr:`210`
149 - Type Annotations have been added.
150 :pr:`198`
151 - Add some basic logging to SimpleCache and FileSystemCache for better
152 observability.
153 :pr:`203`
154 - Add option in memoize to ignore args
155 :pr:`201`
156 - Stop marking wheels as Python 2 compatible.
157 :pr:`196`
158 - Fix ``default_timeout`` not being properly passed to its super constructor.
159 :pr:`187`
160 - Fix ``kwargs`` not being passed on in function ``_memoize_make_cache_key``.
161 :pr:`184`
162 - Add a Redis Cluster Mode caching backend.
163 :pr:`173`
164 - Do not let PIP install this package on unsupported Python Versions.
165 :pr:`179`
166 - Fix uWSGI initialization by checking if uWSGI has the 'cache2' option
167 enabled. :pr:`176`
168 - Documentation updates and fixes.
169
170
171 Version 1.9.0
172 -------------
173
174 Released 2020-06-02
175
176 - Add an option to include the functions source code when generating the cache
177 key. :pr:`156`
178 - Add an feature that allows one to completely control the way how cache keys
179 are generated. For example, one can now implement a function that generates a
180 cache key the based on POST requests.
181 :pr:`159`
182 - Fix the cache backend naming collisions by renaming them from ``simple`` to
183 ``simplecache``, ``null`` to ``nullcache`` and ``filesystem`` to
184 ``filesystemcache``.
185 - Explicitly pass the ``default_timeout`` to ``RedisCache`` from
186 ``RedisSentinelCache``.
187 - Use ``os.replace`` instead of werkzeug's ``rename`` due to Windows raising an
188 ``OSError`` if the dst file already exist.
189 - Documentation updates and fixes.
190
191
192 Version 1.8.0
193 -------------
194
195 Released 2019-11-24
196
197 - **BREAKING:** Removed support for Python 2. Python 3.5 and upwards are
198 supported as of now.
199 - Add option to specify if ``None`` is a cached value or not. See
200 :pr:`140` and
201 `#141`
202 - Allow to use ``__caching_id__`` rather than ``__repr__`` as an object
203 caching key.
204 :pr:`123`
205 - The RedisCache backend now support generating the key_prefix via a callable.
206 :pr:`109`
207 - Emit a warning if the ``CACHE_TYPE`` is set to ``filesystem`` but no
208 ``CACHE_DIR`` is set.
209 - Fixes Google App Engine Memcache backend.
210 See issue `#120` for
211 more details.
212 - Various documentation updates and fixes.
213
214
215 Version 1.7.2
216 -------------
217
218 Released 2019-05-28
219
220 **This is the last version supporting Python 2!**
221
222 - Do not run a cached/memoized function if the cached return value is None.
223 :pr:`108`
224
225
226 Version 1.7.1
227 -------------
228
229 Released 2019-04-16
230
231 - Fix introspecting Python 3 functions by using varkw.
232 :pr:`101`
233 - Remove leftover files (``uwsgi.py``) in PyPI package. See issue
234 `#102` for more details.
235
236
237 Version 1.7.0
238 -------------
239
240 Released 2019-03-29
241
242 - Added a feature called 'response_filter' which enables one to only
243 cache views depending on the response code.
244 :pr:`99`
245 - A DeprecationWarning got turned into a TypeError.
246
247
248 Version 1.6.0
249 -------------
250
251 Released 2019-03-06
252
253 - The ``delete_many`` function is now able to ignore any errors and continue
254 deleting the cache. However, in order to preserve backwards compatibility,
255 the default mode is to abort the deletion process. In order to use the new
256 deletion mode, one has to flip the config setting ``CACHE_IGNORE_ERRORS`` to
257 ``True``. This was and still is only relevant for the **filesystem** and
258 **simple** cache backends.
259 :pr:`94`
260 - Re-added the ``gaememcached`` CACHE_TYPE for improved backwards compatibility.
261 - Documentation improvements
262
263
264 Version 1.5.0
265 -------------
266
267 Released 2019-02-23
268
269 - Add support for a Redis Sentinel Cluster.
270 :pr:`90`
271 - Parameterize the hash function so alternatives can be used.
272 :pr:`77`
273 - Include the deprecated ``werkzeug.contrib.cache`` module in Flask-Caching.
274 :pr:`75`
275
276
277 Version 1.4.0
278 -------------
279
280 Released 2018-04-16
281
282 - Fix logic for creating key for var args in memoize.
283 :pr:`70`
284 - Allow older Werkzeug versions by making the UWSGICache backend conditional.
285 :pr:`55`
286 - Some documentation improvements.
287 :pr:`48`,
288 `#51`,
289 `#56`,
290 `#67`
291 - Some CI improvements.
292 :pr:`49`,
293 `#50`
294
295
296 Version 1.3.3
297 -------------
298
299 Released 2017-06-25
300
301 - Add support for multiple query params and use md5 for consistent hashing.
302 :pr:`43`
303
304
305 Version 1.3.2
306 -------------
307
308 Released 2017-06-25
309
310 - Fix ``spreadsaslmemcached`` backend when using Python 3.
311 - Fix kwargs order when memoizing a function using Python 3.6 or greater.
312 See `#27`
313
314
315 Version 1.3.1
316 -------------
317
318 Released 2017-06-20
319
320 - Avoid breakage for environments with Werkzeug<0.12 installed because
321 the uwsgi backend depends on Werkzeug >=0.12. See `#38`
322
323
324 Version 1.3.0
325 -------------
326
327 Released 2017-06-17
328
329 - Add uWSGI Caching backend (requires Werkzeug >= 0.12)
330 - Provide a keyword `query_string` to the cached decorator in order to create
331 the same cache key for different query string requests,
332 so long as they have the same key/value (order does not matter).
333 :pr:`35`
334 - Use pytest as test suite and test runner. Additionally, the tests have
335 been split up into multiple files instead of having one big file.
336
337
338 Version 1.2.0
339 -------------
340
341 Released 2017-02-02
342
343 - Allows functions with kwargs to be memoized correctly. See `#18`
344
345
346 Version 1.1.1
347 -------------
348
349 Released 2016-12-09
350
351 - Fix PyPI Package distribution. See `#15`
352
353
354 Version 1.1.0
355 -------------
356
357 Released 2016-12-09
358
359 - Fix 'redis' backend import mechanisim. See `#14`
360 - Made backends a module to better control which cache backends to expose
361 and moved our custom clients into a own module inside of the backends
362 module. See also `#14` (and partly some own changes).
363 - Some docs and test changes. See `#8`
364 and `#12`
365
366
367 Version 1.0.1
368 -------------
369
370 Released 2016-08-30
371
372 - The caching wrappers like `add`, `set`, etc are now returning the wrapped
373 result as someone would expect. See `#5`
374
375
376 Version 1.0.0
377 -------------
378
379 Released 2016-07-05
380
381 - Changed the way of importing Flask-Cache. Instead of using the depreacted
382 method for importing Flask Extensions (via ``flask.ext.cache``),
383 the name of the extension, ``flask_cache`` is used. Have a look at
384 `Flask's documentation`
385 for more information regarding this matter. This also fixes the
386 deprecation warning from Flask.
387 - Lots of PEP8 and Documentation fixes.
388 - Renamed this fork Flask-Caching (``flask_caching``) as it will now be
389 available on PyPI for download.
390
391 In addition to the above mentioned fixes, following pull requests have been
392 merged into this fork of `Flask-Cache`:
393
394 - `#90 Update documentation: route decorator before cache`
395 - `#95 Pass the memoize parameters into unless().`
396 - `#109 wrapped function called twice`
397 - `#117 Moves setting the app attribute to the _set_cache method`
398 - `#121 fix doc for delete_memoized`
399 - `#122 Added proxy for werkzeug get_dict`
400 - `#123 "forced_update" option to 'cache' and 'memoize' decorators`
401 - `#124 Fix handling utf8 key args` (cherry-picked)
402 - `#125 Fix unittest failing for redis unittest`
403 - `#127 Improve doc for using @cached on view`
404 - `#128 Doc for delete_memoized`
405 - `#129 tries replacing inspect.getargspec with either signature or getfullargspec if possible`
406 - `make_cache_key() returning incorrect key` (cherry-picked)
407
408
409 Version 0.13
410 ------------
411
412 Released 2014-04-21
413
414 - Port to Python >= 3.3 (requiring Python 2.6/2.7 for 2.x).
415 - Fixed bug with using per-memoize timeouts greater than the default timeout
416 - Added better support for per-instance memoization.
417 - Various bug fixes
418
419
420 Version 0.12
421 ------------
422
423 Released 2013-04-29
424
425 - Changes jinja2 cache templates to use stable predictable keys. Previously
426 the key for a cache tag included the line number of the template, which made
427 it difficult to predict what the key would be outside of the application.
428 - Adds config variable `CACHE_NO_NULL_WARNING` to silence warning messages
429 when using 'null' cache as part of testing.
430 - Adds passthrough to clear entire cache backend.
431
432
433 Version 0.11.1
434 --------------
435
436 Released 2013-04-7
437
438 - Bugfix for using memoize on instance methods.
439 The previous key was id(self), the new key is repr(self)
440
441
442 Version 0.11
443 ------------
444
445 Released 2013-03-23
446
447 - Fail gracefully in production if cache backend raises an exception.
448 - Support for redis DB number
449 - Jinja2 templatetag cache now concats all args together into a single key
450 instead of treating each arg as a separate key name.
451 - Added delete memcache version hash function
452 - Support for multiple cache objects on a single app again.
453 - Added SpreadSASLMemcached, if a value is greater than the memcached threshold
454 which defaults to 1MB, this splits the value across multiple keys.
455 - Added support to use URL to connect to redis.
456
457
458 Version 0.10.1
459 --------------
460
461 Released 2013-01-13
462
463 - Added warning message when using cache type of 'null'
464 - Changed imports to relative instead of absolute for AppEngine compatibility
465
466
467 Version 0.10.0
468 --------------
469
470 Released 2013-01-05
471
472 - Added `saslmemcached` backend to support Memcached behind SASL authentication.
473 - Fixes a bug with memoize when the number of args != number of kwargs
474
475
476 Version 0.9.2
477 -------------
478
479 Released 2012-11-18
480
481 - Bugfix with default kwargs
482
483
484 Version 0.9.1
485 -------------
486
487 Released 2012-11-16
488
489 - Fixes broken memoized on functions that use default kwargs
490
491
492 Version 0.9.0
493 -------------
494
495 Released 2012-10-14
496
497 - Fixes memoization to work on methods.
498
499
500 Version 0.8.0
501 -------------
502
503 Released 2012-09-30
504
505 - Migrated to the new flask extension naming convention of flask_cache instead of flaskext.cache
506 - Removed unnecessary dependencies in setup.py file.
507 - Documentation updates
508
509
510 Version 0.7.0
511 -------------
512
513 Released 2012-08-25
514
515 - Allows multiple cache objects to be instantiated with different configuration values.
516
517
518 Version 0.6.0
519 -------------
520
521 Released 2012-08-12
522
523 - Memoization is now safer for multiple applications using the same backing store.
524 - Removed the explicit set of NullCache if the Flask app is set testing=True
525 - Swapped Conditional order for key_prefix
526
527
528 Version 0.5.0
529 -------------
530
531 Released 2012-02-03
532
533 - Deleting memoized functions now properly functions in production
534 environments where multiple instances of the application are running.
535 - get_memoized_names and get_memoized_keys have been removed.
536 - Added ``make_name`` to memoize, make_name is an optional callable that can be passed
537 to memoize to modify the cache_key that gets generated.
538 - Added ``unless`` to memoize, this is the same as the unless parameter in ``cached``
539 - memoization now converts all kwargs to positional arguments, this is so that
540 when a function is called multiple ways, it would evaluate to the same cache_key
541
542
543 Version 0.4.0
544 -------------
545
546 Released 2011-12-11
547
548 - Added attributes for uncached, make_cache_key, cache_timeout
549 to the decorated functions.
550
551
552 Version 0.3.4
553 -------------
554
555 Released 2011-09-10
556
557 - UTF-8 encoding of cache key
558 - key_prefix argument of the cached decorator now supports callables.
559
560
561 Version 0.3.3
562 -------------
563
564 Released 2011-06-03
565
566 Uses base64 for memoize caching. This fixes rare issues where the cache_key
567 was either a tuple or larger than the caching backend would be able to
568 support.
569
570 Adds support for deleting memoized caches optionally based on function parameters.
571
572 Python 2.5 compatibility, plus bugfix with string.format.
573
574 Added the ability to retrieve memoized function names or cache keys.
575
576
577 Version 0.3.2
578 -------------
579
580 Bugfix release. Fixes a bug that would cause an exception if no
581 ``CACHE_TYPE`` was supplied.
582
583 Version 0.3.1
584 -------------
585
586 Pypi egg fix.
587
588
589 Version 0.3
590 -----------
591
592 - CACHE_TYPE changed. Now one of ['null', 'simple', 'memcached',
593 'gaememcached', 'filesystem'], or an import string to a function that will
594 instantiate a cache object. This allows Flask-Cache to be much more
595 extensible and configurable.
596
597
598 Version 0.2
599 -----------
600
601 - CACHE_TYPE now uses an import_string.
602 - Added CACHE_OPTIONS and CACHE_ARGS configuration values.
603 - Added delete_memoized
604
605
606 Version 0.1
607 -----------
608
609 - Initial public release