flask-caching icon indicating copy to clipboard operation
flask-caching copied to clipboard

Cache raised werkzeug HTTPExceptions

Open snarfed opened this issue 2 years ago • 1 comments

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 avatar Jan 25 '23 04:01 snarfed

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

snarfed avatar Jan 25 '23 06:01 snarfed