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

Cache raised werkzeug HTTPExceptions #444

Open
snarfed opened this issue Jan 25, 2023 · 1 comment
Open

Cache raised werkzeug HTTPExceptions #444

snarfed opened this issue Jan 25, 2023 · 1 comment

Comments

@snarfed
Copy link
Contributor

snarfed commented Jan 25, 2023

Hi all! Flask-caching currently happily caches non-2xx/3xx responses returned from view functions and classes, but not raised werkzeug HTTPExceptions. It'd be nice if it could!

I'm going to try to hack this into a wrapper, I'll post back here once I have that working.

snarfed added a commit to snarfed/webutil that referenced this issue Jan 25, 2023
…error

catch and return them instead of letting them propagate so that flask-cache can cache them

pallets-eco/flask-caching#444
@snarfed
Copy link
Contributor Author

snarfed commented Jan 25, 2023

^ that commit has a working example of a wrapper that catches and returns werkzeug HTTPExceptions, which makes flask-caching cache them correctly.

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

No branches or pull requests

1 participant