Merge pull request #3017 from matrix-org/erikj/add_cache_control_headers

Add Cache-Control headers to all JSON APIs
pull/3035/head
Erik Johnston 2018-03-27 13:10:38 +01:00 committed by GitHub
commit 03a26e28d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -488,6 +488,7 @@ def respond_with_json_bytes(request, code, json_bytes, send_cors=False,
request.setHeader(b"Content-Type", b"application/json")
request.setHeader(b"Server", version_string)
request.setHeader(b"Content-Length", b"%d" % (len(json_bytes),))
request.setHeader(b"Cache-Control", b"no-cache, no-store, must-revalidate")
if send_cors:
set_cors_headers(request)