add content-length and etag headers to thumbnail endpoint

This commit is contained in:
emma 2025-03-10 13:58:41 -04:00
parent d8365c734f
commit a42d83c9f6
No known key found for this signature in database
GPG Key ID: BB0C1BCADFE636B5

View File

@ -433,7 +433,11 @@ class CollectionOps:
async for chunk in resp.content.iter_chunked(4096):
yield chunk
headers = {"Cache-Control": "max-age=3600, stale-while-revalidate=86400"}
headers = {
"Cache-Control": "max-age=3600, stale-while-revalidate=86400",
"Content-Length": f"{image_file.size}",
"Etag": f'"{image_file.hash}"',
}
return StreamingResponse(reader(), media_type=image_file.mime, headers=headers)
async def list_collections(