Skip to main content
All Case Studies
Magento 1 Performance PHP Background Processing

Image Import Performance: From 52 Minutes to 22 Seconds

Challenge

A product image import timed out after 10 minutes on every run, processing only ~100 of 580 images. The client had worked around this for months by importing 7-8 products at a time, an extremely slow and manual process.

What Was Built

Root cause: clearImageCache() was called once per image - 580 recursive directory scans of the media cache at ~8.6 seconds each (580 x 8.6s = ~83 min). The import was rebuilt as a proper background process: decoupled from the browser session and its PHP timeout, with per-image cache flushes replaced by a single batch flush after all images are written. Added parallel run prevention via lock, Magento indexer management during the run, custom error handling, and email notification on completion with summary statistics.

Outcome

Import time dropped from 52 minutes to 22 seconds for 580 images. The client can now import full product catalogs in a single run with no manual batching.

Have a similar challenge?

Get in touch - no sales pitch, just a straightforward conversation.

Contact me