[Perf] Thumbnail-Endpoint + pHash/EXIF-Cache #23
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Probleme
a)
/previewliefert Original-JPEG als Thumbnail —index.html:1293,server.py:227-238Review-Liste laedt bei 200 Fotos potenziell 200x3 MB = 600 MB.
b) Keine Cache-Header auf
/preview,/exif. Browser re-fetcht bei jedem Reload.c) Kein pHash/EXIF-Cache zwischen Runs. Re-Analyse rechnet alles neu.
Fix
/thumb?path=...&w=200mit Disk-Cache.ETagaus mtime +Cache-Control: private, max-age=3600.analyzer_cache.jsonmit{md5+mtime: {phash, exif, brightness, ...}}.Fix (a) und (b) umgesetzt:
(a)
/thumb-EndpointGET /thumb?path=...&w=200(min 32, max 800)<tempdir>/of-thumbs/<md5(path|mtime|w)>.jpgmakeThumbnutzt jetzt/thumb?w=240(Lightbox-Klick laedt weiterhin/previewmit voller Aufloesung)(b) Cache-Header
_file_etag,_cache_response,_not_modified_if/preview,/thumb,/exifsetzenETag(mtime-size+ ggf.-wN) undCache-Control: private, max-age=3600If-None-MatchpasstManueller Test mit 2000x1500 JPEG (47 KB):
/thumb?w=240-> 556 B (99% Ersparnis)/previewmit ETag -> HTTP 304(c) pHash/EXIF-Disk-Cache zwischen Runs als separates Issue #29 ausgegliedert.