We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 494d498 commit 9b8ae27Copy full SHA for 9b8ae27
src/flask_caching/__init__.py
@@ -414,10 +414,11 @@ def decorated_function(*args, **kwargs):
414
if found and self.app.debug:
415
logger.info(f"Cache used for key: {cache_key}")
416
if response_hit_indication:
417
+ g.flask_caching_hit_cache = found
418
419
def apply_caching(response):
- if found:
420
- response.headers["hit_cache"] = found
+ if g.flask_caching_hit_cache:
421
+ response.headers["hit_cache"] = g.flask_caching_hit_cache
422
return response
423
424
self.app.after_request_funcs[None].append(apply_caching)
0 commit comments