Add Cache-Control header to media endpoints (#2612)

* Add Cache-Control header

* Raise rate_limiting threshold to 20
This commit is contained in:
Till 2022-08-03 10:55:21 +02:00 committed by GitHub
parent df5d4dc7a3
commit ac2dbb3513
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -192,7 +192,7 @@ client_api:
# and appservice users are exempt from rate limiting by default. # and appservice users are exempt from rate limiting by default.
rate_limiting: rate_limiting:
enabled: true enabled: true
threshold: 5 threshold: 20
cooloff_ms: 500 cooloff_ms: 500
exempt_user_ids: exempt_user_ids:
# - "@user:domain.com" # - "@user:domain.com"

View File

@ -195,7 +195,7 @@ client_api:
# and appservice users are exempt from rate limiting by default. # and appservice users are exempt from rate limiting by default.
rate_limiting: rate_limiting:
enabled: true enabled: true
threshold: 5 threshold: 20
cooloff_ms: 500 cooloff_ms: 500
exempt_user_ids: exempt_user_ids:
# - "@user:domain.com" # - "@user:domain.com"

View File

@ -149,6 +149,9 @@ func makeDownloadAPI(
} }
} }
// Cache media for at least one day.
w.Header().Set("Cache-Control", "public,max-age=86400,s-maxage=86400")
Download( Download(
w, w,
req, req,