Performance: GZip, Cache-Control, WebP, SQLite-Tuning, Indizes, srcset — SW by-v438, APP_VER 417
This commit is contained in:
parent
5bd07d9598
commit
e0c2b2bdc1
10 changed files with 46 additions and 12 deletions
|
|
@ -90,7 +90,7 @@ def _save_upload(file: UploadFile, data: bytes) -> str:
|
|||
else:
|
||||
preview_bytes = generate_preview(data, ext)
|
||||
if preview_bytes:
|
||||
with open(os.path.splitext(path)[0] + "_preview.jpg", "wb") as f:
|
||||
with open(os.path.splitext(path)[0] + "_preview.webp", "wb") as f:
|
||||
f.write(preview_bytes)
|
||||
return f"/media/forum/{filename}"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue