pedigrianaliz.com is a free pedigree analysis site I built for Turkish horse racing. It turns official race data into progeny statistics for stallions and mares. The content was solid, but the home page loaded slowly on phones. This post covers what I measured, what I changed and what happened.
Starting point: mobile score 78, LCP 5.6 seconds
PageSpeed Insights gave the home page 78 on mobile. The largest element (LCP) was the photo of the featured stallion, and it painted at 5.6 seconds. Google’s “good” threshold is 2.5 seconds.
The LCP breakdown showed the download was not the problem:
- Time to first byte: 10 ms
- Resource load delay: 190 ms
- Resource load time: 70 ms
- Element render delay: 2,070 ms
The image arrived quickly, then waited two seconds to be painted. The second issue was size: the phone displayed the image at 324 px wide but downloaded a 720 px file.
What I changed
1. Let the browser pick the right width
The photo service could already resize images. I added a srcset with 320, 480, 640 and 720 px candidates and wrote sizes from the measured display width, not a guess. A 1.75x phone now gets the 640 px file and desktop gets 480.
2. Fetch it first
The image got fetchpriority="high", and the head got a matching preload with the same srcset. The browser starts the request before it finishes parsing the HTML.
3. Remove what blocked the paint
The two second wait came from the main thread. Two fonts were preloaded on page start and the Analytics script ran before first paint. I dropped the font preloads and moved Analytics to after page load. The trade off: a visitor who leaves before the page finishes loading may not be counted. I accepted that for the speed gain.
4. Serve the banners as WebP
The ad banners were PNG. I wrapped them in <picture> with a WebP source and the PNG as fallback. The mobile banner went from 62 KB to 32 KB. The PNG files stayed, since older app versions may still request those URLs.
Result
- Mobile PageSpeed score: 78 to 95
- LCP: 5.6 s to 2.7 s
- Speed Index: 3.7 s to 2.1 s
- Layout unchanged, layout shift stayed near zero (0.009)
What I took away
When LCP is high, the first instinct is to shrink the image. Here the file size was the small part. Most of the time was spent after the download, waiting to paint. Read the LCP breakdown before optimizing, or the effort goes to the wrong place.
If your site has a similar speed problem, get in touch.