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:
+3
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user