Debian Codegraph @

CHANGELOG.md

raw
1 # Changelog
2
3 All notable changes to `flask-compress` will be documented in this file.
4
5 ## 1.25 (2026-09-15)
6
7 - support, and test against, Python 3.15
8 - return an empty `204 No Content` response when the Flask `after_request` hook receives no response, [#83](https://github.com/colour-science/flask-compress/pull/83) by @mmdbalkhi
9
10 ## 1.24 (2026-03-31)
11
12 - add mypy annotations and mark it as checkable, [#76](https://github.com/colour-science/flask-compress/pull/76) by @orborde
13 - enable trusted publishing, allowing GitHub Actions to publish releases to PyPI without long lived credentials, [#78](https://github.com/colour-science/flask-compress/issues/78) by @alexprengere
14
15 ## 1.23 (2025-11-06)
16
17 - add `gzip` to supported algorithms for streaming responses, but not in the `COMPRESS_ALGORITHM_STREAMING` default values, so users have to explicitly enable it
18 - add Windows and MacOS to the list of platforms tested on GitHub Actions
19
20 ## 1.22 (2025-11-04)
21
22 - fix possible `RuntimeError` when applying compression to a streaming endpoint
23 - no longer apply `make_conditional` to streaming responses, as it had the effect of buffering the entire response, which defeats the purpose of streaming responses, unless the `request.endpoint` is in a new `COMPRESS_STREAMING_ENDPOINT_CONDITIONAL` config option, which defaults to `["static"]`
24
25 > As serving static content with Flask is using *streaming* responses, we wanted to preserve the correct handling of conditional requests (i.e. 304 Not Modified responses) for static content, while avoiding buffering the entire response when compressing streaming responses for other endpoints
26
27 ## 1.21 (2025-11-04, yanked)
28
29 - compressing *streaming* responses is now supported:
30 - the *previous* behavior was:
31 - if `COMPRESS_STREAMS` was `True` (the default), streaming responses were compressed in *1 sitting* using `response.get_data()`, meaning streaming responses were compressed but *not streamed*
32 - if `COMPRESS_STREAMS` was `False`, streaming responses were not compressed at all
33 - the *new* behavior is:
34 - if `COMPRESS_STREAMS` is `True`, streaming responses are compressed chunk-by-chunk using `response.iter_encoded()`, which means that streaming responses are compressed and streamed
35 - if `COMPRESS_STREAMS` is `False`, streaming responses are not compressed at all, as before.
36 - we have a new `COMPRESS_ALGORITHM_STREAMING` config option to specify the compression algorithm to use for streaming responses, which defaults to `["zstd", "br", "deflate"]`, as `"gzip"` is not suitable for streaming compression.
37 - ⚠️ serving static content with Flask is actually using *streaming* responses, so if you enable streaming compression, static content will be compressed chunk-by-chunk as well, which may not be what you want.
38
39 ## 1.20 (2025-10-20)
40
41 - the new `COMPRESS_EVALUATE_CONDITIONAL_REQUEST` config option is now `True` by default
42
43 ## 1.19 (2025-10-20)
44
45 - Use `backports.zstd` instead of `pyzstd`, [#63](https://github.com/colour-science/flask-compress/pull/63) by @alexprengere
46 - Add new behaviours to improve Etag compatibility, [#67](https://github.com/colour-science/flask-compress/pull/67), by @jlopex
47 - weak etags are no longer modified by flask-compress
48 - add new `COMPRESS_EVALUATE_CONDITIONAL_REQUEST` config option to call `response.make_conditional(request)` after compression, this ensures that 304 Not Modified responses are correctly generated when the client sends conditional requests with `If-None-Match` (defaults to `False`)
49
50 ## 1.18 (2025-07-11)
51
52 - Support, and test against, Python 3.14, see [#61](https://github.com/colour-science/flask-compress/pull/61) by @kurtmckee
53 - Migrate from `zstandard` to `pyzstd`, which is now included in the Python 3.14 standard library, also part of [#61](https://github.com/colour-science/flask-compress/pull/61)
54 - Restore `flask_compress.DictCache()` that is needed to configure Flask-Compress with caching, without relying on [Flask-Caching](https://pypi.org/project/Flask-Caching/)
55
56 ## 1.17 (2024-10-14)
57
58 - Add support for Python 3.13 in tox and classifiers
59 - Expand mimetype defaults, see [#57](https://github.com/colour-science/flask-compress/pull/57)
60 - Minor performance improvements, cache the algorithm selection logic
61
62 ## 1.16 (2024-10-13)
63
64 - Drop support for Python 3.8 and lower, see [#46](https://github.com/colour-science/flask-compress/pull/46)
65 - Fix cache pollution caused by caching compression results for different compression algorithms, see [#53](https://github.com/colour-science/flask-compress/issues/53)
66
67 ## 1.15 (2024-04-24)
68
69 - Add support of Zstandard compression.
70
71 ## 1.14 (2023-09-11)
72
73 - Add `text/javascript` mimetype. See [#41](https://github.com/colour-science/flask-compress/pull/41)
74 - Use [brotlicffi](https://github.com/python-hyper/brotlicffi) for PyPy
75
76 ## 1.13 (2022-09-21)
77
78 - Re-enable compression for streaming, but hide it behind a new option `COMPRESS_STREAMS` that defaults to `True`. See [#36](https://github.com/colour-science/flask-compress/pull/36)
79
80 ## 1.12 (2022-04-28)
81
82 - Disable compression when response is streamed, see [#31](https://github.com/colour-science/flask-compress/pull/31)
83
84 ## 1.11 (2022-03-01)
85
86 - When compression is enabled, *accept-encoding* is always added to the `Vary` header, fixes [#28](https://github.com/colour-science/flask-compress/issues/28)
87
88 ## 1.10.0 (2021-06-15)
89
90 - Automate the release process with GitHub Actions
91 - Use `setuptools_scm` to manage package versions
92 - The layout is now an actual package rather than a single module
93 - Clean up unused files
94
95 ## 1.9.0 (2021-02-12)
96
97 - Add support for the `identity` value in *accept-encoding*, fixes [#19](https://github.com/colour-science/flask-compress/issues/19)
98
99 ## 1.8.0 (2020-11-03)
100
101 - Support ETag header as defined in *RFC7232* [#17](https://github.com/colour-science/flask-compress/pull/17)
102 - Implement per-view compression [#14](https://github.com/colour-science/flask-compress/pull/14)
103
104 ## 1.7.0 (2020-10-09)
105
106 - The following parameters to control Brotli compression are now available: [#10](https://github.com/colour-science/flask-compress/pull/10)
107 - `COMPRESS_BR_MODE`
108 - `COMPRESS_BR_LEVEL`
109 - `COMPRESS_BR_WINDOW`
110 - `COMPRESS_BR_BLOCK`
111 - Add deflate support, with `COMPRESS_DEFLATE_LEVEL` to control compression level (default is `-1`) [#8](https://github.com/colour-science/flask-compress/pull/8)
112 - The default quality level for Brotli is now `4`, which provides compression comparable to `gzip` at the default setting, while reducing the time required versus the Brotli default of `11`
113
114 ## 1.6.0 (2020-10-05)
115
116 - Support for multiple compression algorithms and quality factors [#7](https://github.com/colour-science/flask-compress/pull/7)
117 - Modified default compression settings to use Brotli when available before `gzip`
118
119 ## 1.5.0 (2020-05-09)
120
121 - Add Brotli support [#1](https://github.com/colour-science/flask-compress/pull/1)