flask-caching
flask-caching copied to clipboard
Include HTTP method in cache key
I hit a bit of a nasty surprise recently when I cached a view like this, and found that HEAD responses were being cached and returned to GET requests. We should probably include the HTTP method in the cache key by default, right?
@app.route('/foo', methods=['HEAD', 'GET'])
@cache.cached(600)
def foo():
...
(I know work here is on a bit of a hiatus right now due to #268! Totally ok, just filing to keep track.)