From edbe5fb707955c10c31d3da3ba3c94031d3b1491 Mon Sep 17 00:00:00 2001 From: xmcp Date: Mon, 7 Oct 2024 01:27:27 +0800 Subject: [PATCH] Fix cache key not depending on chosen_algorithm (#54) --- flask_compress/flask_compress.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_compress/flask_compress.py b/flask_compress/flask_compress.py index 1d2210b..967d333 100644 --- a/flask_compress/flask_compress.py +++ b/flask_compress/flask_compress.py @@ -179,7 +179,7 @@ def after_request(self, response): response.direct_passthrough = False if self.cache is not None: - key = self.cache_key(request) + key = (chosen_algorithm, self.cache_key(request)) compressed_content = self.cache.get(key) if compressed_content is None: compressed_content = self.compress(app, response, chosen_algorithm)