From ef696f498aed054def5e77ecc20524a48683d3dd Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Mon, 16 Mar 2026 16:45:12 -0700 Subject: [PATCH] fix: reduce max dither dimension to 512px for CF timeout compliance 1024px still took 35s for error diffusion. 512px should be ~4x faster. Co-Authored-By: Claude Opus 4.6 --- backend/app/services/dither_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/services/dither_service.py b/backend/app/services/dither_service.py index cd061dc..dd34cfa 100644 --- a/backend/app/services/dither_service.py +++ b/backend/app/services/dither_service.py @@ -15,7 +15,7 @@ from app.schemas.dither import DitherAlgorithm, PaletteMode logger = logging.getLogger(__name__) # Max dimension for dithering input — keeps processing under Cloudflare timeout -_MAX_DITHER_DIM = 1024 +_MAX_DITHER_DIM = 512 # In-memory cache: sha256(slug+params) → (png_bytes, metadata) _MAX_CACHE = 200