Audit · Who What Wear

Who What Wear: CLS from 0.30 to 0, LCP from 2.5s to 1.5s

Their team had worked on LCP and layout shifts for months. The big one was a product gallery that only existed once the script had run.

0CLS on mobile, was 0.30
1.5sLCP on mobile, was 2.5s
2sessions of about two hours
ClientWho What Wear, fashion articles and shopping
ServiceAudit, a short one
The client

Who What Wear, fashion articles with ads

My wife has shown me a lot of things on Who What Wear. Their product gallery was the first one I had an opinion about.

The RUM data already showed which pages shifted. They asked me for a short audit to find out why.

Who What Wear homepage
What we found, what we did

A product gallery built entirely in JavaScript, and smaller shifts around it

The gallery was the big one. Also on the list: a slider, an LCP image with loading="lazy", third-party scripts, a sticky element and infinite scroll. Their developers took the list from there.

What was wrong
What we did
LCPCLS
The HTML had no images for the gallery. They arrived when the script ran, so the LCP waited for JavaScript and the gallery pushed the text under it down.
The images are in the HTML, so the browser paints the first one before any JavaScript runs. The script adds the scroller and the zoom afterwards, and nobody misses those in the first second.
CLS
The fallback font took up different space than the web font, so the text reflowed when the web font arrived.
The fallback font was matched in size to the web font, so the text no longer reflows.
CLS
Modules that loaded asynchronously pushed the content around them.
Each got a placeholder at its final size.
The ad slots

The ads shifted the page too. In their old stylesheet only the header ad had a minimum height, so the other slots had no height until an ad filled them, and the text under them jumped. Their developers gave the slots their size before the ad loads: 480 pixels for the first ad in an article on a phone, 100 for the header. Those builds went live in April 2021.

Beforetheir CSS build: only the header ad had a minimum height
.placement--header{min-height:180px}.placement--navbar{background-color:transparent;display:inline-block}
Afterthe next builds: the slots get their size before the ad arrives
#placement-incontent-1.placement--incontent-mobilerectangle{height:480px}.layout--phone .container--page-section .ad-mount[data-id=header],.layout--phone .container--page-section .placement--header{height:100px}.placement--navbar{background-color:transparent;display:inline-block;height:40px;width:200px}
Who What Wear’s own stylesheet in the Internet Archive, builds of 24 February and 8 and 28 April 2021.
In CrUX

You can follow the fixes in CrUX. The layout shifts went first: CLS on mobile was 0.30 through 2020, came down in February and March 2021, and the April builds with the ad slots took it to 0, where it has stayed. The gallery took longer, because rebuilding a component takes more than giving a slot its height. When the new gallery went live in September 2021, LCP on mobile, which had sat at 2.4 to 2.5 seconds all year, dropped to 1.7 that month, and it was down to 1.5 by early 2022.

0.100.250.30Jul 2020OctJan 2021AprJulOctJan 2022Apr0.00CLS on mobile, p75
2.5 s4.0 s2.1 sJul 2020Oct2.5 sJan 2021AprJulOctJan 2022Apr1.5 sLCP on mobile, p75
whowhatwear.com in CrUX, phone, July 2020 to June 2022. One bar per month, p75, from Google’s CrUX data in BigQuery. Green is good, orange needs improvement, red is poor.
Afterwards

Their own RUM showed each change within days of going live, long before CrUX caught up.

"Arjen, your recommendations make a lot of sense! I am glad we asked you!"

K Klein, VP Product Management, Who What Wear

What we learned

Months of fixes, and one component that held them back

Their team had fixed a lot in those months. The biggest cause left was one component: a gallery that waited for JavaScript.

The ads can stay

They kept their ads and their ad revenue, and passed Core Web Vitals. What changed was how and when the ads and modules loaded.

Arjen Karel

CLS still over 0.1 after all the fixes?

One week. I find the cause in your field data and put the fixes in order for your developers.

Who What Wear: CLS 0.30 to 0, LCP 2.5s to 1.5s Core Web Vitals Who What Wear: CLS 0.30 to 0, LCP 2.5s to 1.5s