...but with AI? 🤔
by Ryan Oeltjenbruns
Why are some sites faster than others?
Hint: no matter the site, the answer is the
Poor performance here is indicated by the TTFB - all of the work the server has to do to render html
The amount of data required for a pageload - what are we transferring across the wire and where is it coming from?
The instructions we give to the browser to render a page - what are we asking the browser to do and in what order?
Different sites have different server performance metrics. Consider the following:
The more a server has to do for each page it renders, the likelier that server is going to need Zach's help.
Databases are one of the biggest performance considerations in server performance - ESPECIALLY for WordPress.
Poor performing queries can always be "explained":
EXPLAIN SELECT * FROM wp_posts WHERE meta_value LIKE "%foo%";
Yes, I know... I spelled "Unoptomized" and "Optomized" incorrectly 🤣
A server can only do so much work within a given amount of time.
Check out the whitepaper I made for WP Engine 10 years ago (still mostly relevant for WP)
Scaling WordPress for High TrafficThat's where I got that photo from. 2015 me 😁👍
Transferring all of the content isn't free either!
A site who's total payload is 10kb will load faster than one that's 10mb (1000x larger).
More on this in the Browser Processing section...
I remember downloading a 3mb song @ 3kb/s.
~20 minutes later we were jammin' 😁👍
The riaa hadn't found us yet
Nailed it.
Let's start by discussing some of the interesting limitations modern browsers have - most folks (including devs) aren't familiar with.
TCP vs. UDP.
I would tell you a joke about UDP, but you probably wouldn't get it. So here's a TCP joke.
Built on TCP, limits the browser to a maximum of 6 concurrent connections
Don't go chasin' waterfalls... unless you're on HTTP/1.1
Relies on a SINGLE TCP connection with Multiplexing
Like http/2, but solves the packet conundrum by using QUIC (built on top of UDP)
If you don't know about the main thread...
...you're gonna have a bad time.
The main thread handles
...the downloading of the files is non-blocking, but what happens with them is not!
Your Bootstrap 5 + Javascript SPA might be the coolest app since sliced bread, but the browser has to parse, compile, and execute it. During which time...
This is your browser on CSS & Javascript. Any questions?
...is ded. 👀
Modern browsers now cache assets per TLD (for privacy reasons).
In short: Serve local; don't add another DNS lookup.
In loving memory of cdn.jquery.com
Circa ~2026
At least the important ones...
⬇️ for more info 👍
Translation: How long does it take for the biggest, most important thing on the screen (usually the hero image or main headline) to show up?
Translation: When a user taps a button, opens a menu, or adds an item to their cart, how long does it take for the site to visually react?
Translation: Does the page jump around while the user is trying to read or click something?
Translation: How much total time is the browser completely frozen and ignoring the user while it processes our code?
I'm so proud of you 😁👍
gotcha 😉
Wrapping all of our tiny scripts and js segments in their own
or
$(document).ready()
checks.
DOMContentLoaded
I'm not calling
This has huge impacts on Total Blocking Time (TBT), followed immediately by terrible Interaction to Next Paint (INP).
Since we're bundling with Webpack, strip out the
wrappers entirely and rely on Webpack's module system (ES modules or CommonJS) to manage dependencies,
and load the single compiled script at the bottom of the HTML body (or use the defer attribute)
😁👍
document.ready
Now that you know some stuff...
And how can I use it for the benefit of our clients' websites?
I gotchu - 4 ways to use AI to suss out performance issues.
Run a Lighthouse test in Chrome DevTools, click "Export JSON", upload the file to their AI of choice, and try this prompt:
Act as a Senior Web Performance Engineer. I have uploaded my raw Lighthouse diagnostic JSON. Please analyze the data and identify the top 3 biggest bottlenecks impacting Total Blocking Time (TBT) and Largest Contentful Paint (LCP). For each issue, provide one permanent technical fix for the development team, and one immediate, temporary mitigation strategy the marketing/ops team can implement today.
Load the site in your browser, wait for it to fully load, go to the Elements tab, right-click the <body> tag, select "Copy outerHTML", and paste it in along with this:
I am pasting the fully rendered HTML of my website. Act as a performance auditor and identify all
third-party scripts (trackers, chat widgets, ad pixels) injected into this page that are likely
fighting for the Main Thread. Rank them by their potential negative impact on Interaction to Next
Paint (INP). Suggest a strategy to delay, defer, or lazy-load the heaviest offenders without
breaking their core functionality.
```html
[Paste your copied html code here]
```
Why like this? Because we're looking at the actual rendered DOM --
Copy the compiled site Webpack JS files and use this prompt to hunt down third party shenanigans:
I am pasting a compiled JavaScript file used on our WordPress site. Scan this code specifically for `$(document).ready`, DOMContentLoaded, or similar event listeners that could cause a 'stampede' of execution on the Main Thread right after the HTML parses. Highlight the specific lines causing the bottleneck, and provide a rewritten, modern example using defer or ES modules to fix the Total Blocking Time (TBT) impact.
When you just need to explain a bad PageSpeed Insights score to a client or boss 👀
Once the report completes, use the "Print to PDF" feature and upload that to the LLM.
(Frontier models can just accept the report's URL)
I am going to provide the URL of a PageSpeed Insight Report for you to review the Core Web Vitals (LCP, INP, CLS). Translate these technical failures into a short, 3-bullet-point summary for a non-technical executive. Do not use engineering jargon. Focus entirely on how these specific bottlenecks are currently causing user frustration, abandonment, and lost conversions, using simple real-world analogies.
Sidenote: No offense to executives, but it's critical that they have clarity whether or not they have the technical chops to interpret these things. It's the perfect prompt.