Inside the widget speed program: cutting our embed JS by two thirds
A UGC widget lives on someone else’s storefront, so every kilobyte is borrowed. Here is what we cut and what we measured. Plus the new dashboard that shows what your shoppers’ browsers experienced.
Open your product page on a phone, on mobile data. Our widget loads beside your theme, your analytics and a dozen other scripts. Every kilobyte it adds comes out of your Core Web Vitals. We spent a sprint cutting it back. This is the ledger of what we found and what we changed.
In this article
An embedded widget is a guest. The storefront already carries a theme, analytics, a consent manager and a dozen other scripts. The merchant’s Core Web Vitals pay for all of it. We have always engineered against that budget. It is why the widget code-splits every gallery layout. But a deep audit this month found real waste left on the table. This piece walks through the ledger: every line item and the measured saving. Then come the two changes that matter more than the kilobytes.
The ledger: what we cut
| Change | Before | After |
|---|---|---|
| Icon library replaced with generated inline SVGs | 13.9 KB + 1 request | tree-shaken, ~0 |
| React runtime swapped for a compatible 4 KB core | 45.1 KB | 9.7 KB |
| Product modal loads only this session’s variants | 27.9 KB | 22.6 KB |
| Chunk files on the CDN | 148 files | 136 files |
| Critical chunks discovered late (extra round trip) | 4 chunks | 0 |
Two items deserve a word. The icon change sounds trivial and is not. Our 87 icons pulled in a 40 KB vendor bundle. The actual path data was about 3 KB. So we generated our own components once and deleted the dependency. The modal change is about fairness across devices. A desktop shopper was downloading the mobile bottom-sheet. A Shopify store was downloading the WooCommerce panel. And everyone was downloading one customer’s demo dataset. Each variant now loads only where it can actually render.
JavaScript on the critical path, gzipped
- Before the program~122 KB
- After the full program~44 KB
- Lite mode, to paint a grid~4.5 KB
The bigger win: loading nothing
Bundle size is the second-order problem. The first-order problem is loading code on pages that will never show content. Take a product page whose product has no tagged posts. It used to download the entire widget, mount it, find the empty response, and hide. The loader now remembers which galleries came back empty. It races first visits against the data response. It skips the bundle when there is nothing to paint. Galleries deep below the fold wait for an intersection observer. They no longer tax initial page load.
Want to go further? An experimental lite mode paints the grid from the data response alone. The interactive app arrives lazily afterwards. It is a flag on the embed div. It fails open in every path we could think of. The honest end state of a widget speed program is first pixels that cost almost nothing.
Mobile apps: a supported path, not a shrug
Customers kept asking whether the widget works inside their native apps. The truthful answer was “usually, with sharp edges”. WebViews silently drop window.open, so product taps did nothing. Some ship with storage disabled. Both edges are now handled. Every outbound tap goes through a single exit point. It can send a structured event to React Native, WKWebView or Android. No popup opens. Storage degrades gracefully. A diagnostic panel tells support exactly what that WebView allows. Add idk_appcheck=1 to any URL inside the app to open it. None of this changes anything for regular web embeds; the bridge is strictly opt-in.
Proof over promises: the Performance page
Lab benchmarks flatter everyone. The number that matters is what your shoppers’ browsers measured on your pages. So the widget now sends a small sampled beacon to a new Performance page. It covers time to first tile, data latency, LCP and layout shift. You see your own percentiles, the trend over time, and mobile against desktop. You also see how you compare with the fleet-wide benchmark across all Idukki widgets. When we say the widget got faster, you should be able to check.
Continue reading
1 piece in this clusterThese long-form pieces on the Idukki blog link back to this article, go deeper on the cluster.
More from Rohin Aggarwal
- Strategy
How to add social proof without slowing your store
Add UGC and reviews without the speed tax. Lazy-load, right-size media, keep scripts non-blocking, reserve layout space. A slow widget erases its own lift.
- Strategy
Lightweight UGC at peak: posters under 79KB and zero layout shift
Peak-week PDP traffic exposes heavy galleries. Use poster-first delivery, fixed aspect ratios and deferred video. Customer proof then stays inside Core Web Vitals.
- Strategy
Core Web Vitals Impact of UGC Widgets: Performance Data + Pre-Launch Checklist
Poorly built UGC widgets drop PageSpeed by 15-25 points and add 1.8s to LCP. The SEO loss often outweighs the conversion lift they were bought for.