feat: serve responsive WebP srcsets for faster mobile browsing

On-demand ?w= resize with a disk cache under webcache/; downloads stay full-resolution.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Frank Schwenk
2026-08-01 13:04:33 +02:00
parent b09f90bfcc
commit dec74a46d7
9 changed files with 217 additions and 12 deletions
+3 -1
View File
@@ -14,7 +14,8 @@ def data_dir(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:
intermediates = tmp_path / "intermediates"
meta = tmp_path / "meta"
inbox = tmp_path / "incoming"
for directory in (variants, intermediates, meta, inbox):
webcache = tmp_path / "webcache"
for directory in (variants, intermediates, meta, inbox, webcache):
directory.mkdir()
monkeypatch.setattr("app.config.DATA_DIR", tmp_path)
@@ -22,5 +23,6 @@ def data_dir(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:
monkeypatch.setattr("app.config.INTERMEDIATES_DIR", intermediates)
monkeypatch.setattr("app.config.META_DIR", meta)
monkeypatch.setattr("app.config.INBOX_DIR", inbox)
monkeypatch.setattr("app.config.WEB_CACHE_DIR", webcache)
monkeypatch.setattr("app.config.PROCESSED_FILE", tmp_path / "processed.json")
return tmp_path