Ads are often treated as external integrations, but from the browser's perspective they compete for the same main thread, memory, and network bandwidth as first-party code. Drawing on experience improving the TanStack documentation site, the author argues that ads should be treated as a defined slice of the performance budget rather than an afterthought. This reframes the question from 'how do we add ads without hurting performance?' to 'what portion of our budget do we allocate to monetization, and where do we claw it back elsewhere?' Practical offsets include removing dead JavaScript and CSS, simplifying component boundaries, and delaying non-essential interactivity. The post also highlights why documentation sites are especially sensitive to layout shifts and load delays, and concludes that the real engineering challenge is containment — designing systems that remain stable and fast as they evolve.

7m read timeFrom playfulprogramming.com
Post cover image
Table of contents
Context: Joining TanStack Copy link Link copied!Ads don’t live outside your application Copy link Link copied!Performance budgets are about tradeoffs, not scores Copy link Link copied!The hidden costs of ads Copy link Link copied!“Just Load it async” isn’t a strategy Copy link Link copied!Treating ads as a budgeted system Copy link Link copied!Why Docs and Content Sites Are Especially Sensitive Copy link Link copied!The real work is containment Copy link Link copied!Performance is a product promise Copy link Link copied!

Sort: