Submit each catalogue import as one image batch, persist its batch ID, and let the Express application poll with backoff while it records every item outcome. Short answer: the browser should read progress from your database, not turn the image processor into its progress backend; this keeps refreshes, duplicate requests, and partial failures from losing the only useful account of the job.
For an e-commerce catalogue, compression is rarely the hard part. The hard part is preserving a truthful mapping from a merchant's source item to its optimized image when a 4,000-item import is interrupted halfway through, one image is malformed, or an operator reloads the page. Storage and cache cost depend on avoiding duplicate derivatives and pointless status traffic, so identity and retry behavior belong in the design before codec choices do.
What must remain true when the process restarts?
The architecture decision is to treat the batch ID as durable state, not as an in-memory promise owned by one Node.js process.…