mirror of
https://mau.dev/maunium/synapse.git
synced 2024-09-30 05:05:49 +00:00
Set immutable cache-control header for media downloads
This commit is contained in:
parent
5e7ff45534
commit
ab635c80a7
@ -206,7 +206,9 @@ def add_file_headers(
|
|||||||
# recommend caching as it's sensitive or private - or at least
|
# recommend caching as it's sensitive or private - or at least
|
||||||
# select private. don't bother setting Expires as all our
|
# select private. don't bother setting Expires as all our
|
||||||
# clients are smart enough to be happy with Cache-Control
|
# clients are smart enough to be happy with Cache-Control
|
||||||
request.setHeader(b"Cache-Control", b"public,max-age=86400,s-maxage=86400")
|
request.setHeader(
|
||||||
|
b"Cache-Control", b"public,immutable,max-age=86400,s-maxage=86400"
|
||||||
|
)
|
||||||
if file_size is not None:
|
if file_size is not None:
|
||||||
request.setHeader(b"Content-Length", b"%d" % (file_size,))
|
request.setHeader(b"Content-Length", b"%d" % (file_size,))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user