Project overview
The site lists properties with large photo galleries. Images arrive through an automated import that runs without anyone watching it.
The challenge
The import had no duplicate check and kept adding the same files. When an index was built on the bloated table, it locked and the site went offline. Listing pages and the control panel were also slow.
Technical challenges
- About 66,000 rows in the files table, mostly duplicates from the import.
- An index build locked the table and stopped the site responding.
- Listing pages loaded a 22-image gallery plus Google Maps and YouTube embeds up front.
- Grid fields in the control panel loaded full-size image previews.
Our approach
- Cleaned up the files table from the MySQL command line.
- Added de-duplication to the import so the problem does not come back.
- Converted listing images to WebP and lazy-loaded the 22-image gallery.
- Deferred the Google Maps and YouTube embeds and cached channel entries.
- Fixed the slow control panel caused by full-size previews in Grid fields.