Citizen photo uploads feel slow because thumbnail generation runs on the synchronous upload API path. How should latency be improved?
Select an answer to reveal the explanation.
Short Explanation
Citizens care that the upload finished—not that every thumbnail variant is done this millisecond. Take the photo, say thanks, and queue the thumbnail work. Async offload keeps the API snappy.
Full Explanation
Citizen photo uploads feel slow when thumbnail generation runs on the synchronous upload API path, so latency improves by acknowledging the upload quickly and offloading thumbnail generation to an asynchronous path—for example an S3 event invoking Lambda. The citizen gets a fast confirmation; image processing continues in the background. Synchronous multi-format rendering before HTTP acknowledgment is the antipattern.
Generating higher-resolution thumbnails synchronously before acknowledging the upload increases perceived latency further.
Blocking the HTTP response until three sequential image formats finish rendering maximizes wait time.
Moving all uploads to a single-threaded on-premises script with no queue removes cloud elasticity and async benefits.
Exam caveat: Move heavy post-processing off the synchronous request path using events/queues.
Operational check: Return success after durable store of the original object, trigger async thumbnail jobs via S3 events, show processing state in the UI if needed, and measure upload API p95 improvement for the citizen photo feature. Keep the civic/municipal context in mind: 311 and permits photo uploads are judged by how fast the spinner stops, not how fast every derivative finishes.