Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

response_hit_indication header value is true when "found" is false #595

Open
sumandari opened this issue Dec 19, 2024 · 1 comment · May be fixed by #596
Open

response_hit_indication header value is true when "found" is false #595

sumandari opened this issue Dec 19, 2024 · 1 comment · May be fixed by #596

Comments

@sumandari
Copy link

sumandari commented Dec 19, 2024

hit_cache doesn't reflect the found value

When the key expires, the found value will be False, but apply_caching method after always give 'True' when invoked in after_request_funcs

def apply_caching(response):

'hit_cache': 'True'

expectation:
when found is False, the header will be false in after_request invocation

Environment:

  • Python version: 3.11
  • Flask-Caching version: 2.3.0
@sumandari sumandari changed the title response_hit_indication header always true even "found" is false response_hit_indication header value is true when "found" is false Dec 19, 2024
@sumandari sumandari linked a pull request Dec 19, 2024 that will close this issue
6 tasks
@Denhai
Copy link

Denhai commented Dec 30, 2024

Also, every time the cached function is called, after_request_funcs grows in length?

self.app.after_request_funcs[None].append(apply_caching)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants