The Unofficial Shopify Podcast: Entrepreneur Tales

Is your developer faking your PageSpeed score?

Episode Summary

Uncovering a performance optimization scam

Episode Notes

Everyone wants a better PageSpeed score. So when a client came to us with unusually good PageSpeed scores in a theme we set up last year, we wanted to know how they achieved it so we could replicate the results.

Had a random developer seemingly cracked the code for theme performance optimization for Shopify? Finding out took days of research, and what we found shocked us.

Show Links

Sponsors

Never miss an episode

Help the show

What's Kurt up to?

Episode Transcription

Paul Reda: So, tell me about how you gaslit your wife into buying you a project car.

Kurt Elster: All right, so right now, there’s a lot of… There’s pent up cash, pent up demand, and the housing market has gone wild. So has used cars. Used cars, the price on them has gone crazy. And we needed… We were down to one car as of last year and we said, “All right. Well, the time has come. We gotta buy a second car.” And I was making myself crazy trying to figure out something relatively inexpensive, fun, and that would get me around. And I was so… I was struggling with it so much that I finally… I was like, “Let’s just get a minivan. Just give up.”

And she was like, “No, no, no.” And I said, “I need you to have an opinion.” And she said, “You know, I have always wanted a vintage VW Beetle, and I almost bought one twice in my life.” And I immediately said, “Well, how much could that cost? Go look it up.” Two days later, she’d found one she wanted. We made offers on three. And we ended up with a 1979 VW Super Beetle. Convertible.

Paul Reda: So, what has really happened is here is what… It’s known as a project car, which is when you’re a dork that cares too much about doing car stuff, you have a car with a bunch of shit that’s broken on it, and then you get to fix it. Some people apparently find this enjoyable. So, what happened is you got your wife to say to you, “Kurt, please buy yourself a project car so you can hang out in the garage and show off all the cool little things you did.”

Kurt Elster: We’re very much in alignment on this purchase, though straight up everybody is like, “Well, this is clearly one of Kurt’s hairbrained ideas.” And it really wasn’t.

Paul Reda: Keep telling yourself that, buddy.

Kurt Elster: I swear. She picked it out. She paid for it. It is titled to her. I swear, it’s her car. And I’m thrilled to death to be able to work on it. And get this… Oh, so here comes the free plug. We have a podcast listener who owns what is the largest VW, vintage air-cooled VW parts site. JBugs. And he was a very valuable resource-

Paul Reda: Oh, good.

Kurt Elster: In finding out like, “All right, here’s what to look for, and here’s some issues.”

Paul Reda: Yeah. You were talking about it to me. You were like, “All right. Well, the backup lights don’t work. The electrical system’s totally screwed. The fuel gauge doesn’t work. All the speakers are weird. The radio doesn’t work right. I give it like a B-plus. It’s really good.” And I’m like, “What are you talking about? My cars are pass/fail.” Does something not work? Fail.

Kurt Elster: You know, if you just want one single no-hassle car, sure. But if you just want to torture yourself and call it fun, get yourself a vintage car. I’m telling you. Automotive technology has really come a long way in the last 40 years.

Paul Reda: Yeah. The gas reek when you turned it on was really… really brought some flashbacks.

Kurt Elster: That one, yeah. It’s converted to carburetor.

Paul Reda: Snowblower?

Kurt Elster: It’s got a Weber carb on there.

Paul Reda: Snowblowing in the ‘90s.

Kurt Elster: Yeah. What’s funny is like as soon as Julie started it for the first time, she immediately goes, “Oh my gosh, it reminds me of my childhood.” Like, gas smell?

Paul Reda: Yeah, like getting brain damage?

Kurt Elster: Yeah. Well, and now the garage permanently reeks of gasoline. Just always. You walk in there, you’re like, “Whoa!”

Paul Reda: It’s-

Kurt Elster: That’s carcinogenic.

Paul Reda: It’s a great choice you’ve made.

Kurt Elster: Gotta put a prop 65 warning in here.

Paul Reda: Yeah. Prop 65 warning on your house.

Kurt Elster: So, speaking of things that don’t go particularly quickly, zero to 60 in 20 seconds in that VW, we’re talking about performance optimization today on the show. A topic that we have mixed feelings about because people make themselves crazy trying to make their website faster. And I get why. We essentially have Google and other resources implying that if your website is below a certain threshold, suddenly you won’t rank in Google.

And the reality of this, who knows what that implementation will look like in the coming months? But everybody wants a faster website, and there’s nothing wrong with that, and the go-to tool, like it or not, to figure this out is Google PageSpeed Insights tool. And it unfortunately gives you a score for your website. That’s the part that drives me crazy, is it grades you, and we had this client, we set up a site for them last year. They loved it. Site performed really well. So, we know it works. We know it generates revenue.

And he had someone performance optimize it for him. And out of curiosity, I ran it through-

Paul Reda: Well, let’s settle down here for a second. He didn’t have someone performance optimize it for him. He was teaching to the test. It straight up was he wanted his PageSpeed score to be higher.

Kurt Elster: Okay.

Paul Reda: Because he bought into this idea… I can’t believe we’re fuckin’ talking about Google PageSpeed again. Every time I think I’m out, they pull me back in. And so, he was like, “I got a guy, and he increased my PageSpeed score.” And this is cropping back up again because Google invented a bunch of statistics and then these statistics are gonna be part of Core Web Vitals, and then they said that Core Web Vitals are now gonna be part of the ranking factors for your Google ranking.

Kurt Elster: So, everybody’s in a panic to increase this score.

Paul Reda: Yeah. The score. But they keep pushing it back. It was like, “It’s gonna be in the fall,” and then they were like, “It’s gonna be in March,” and then last week they were like, “It’ll slowly start rolling out in June.” And so, it’s not affecting anyone yet and hasn’t launched at all yet. And yet again, I’m looking through Google’s FAQs here, but every time they’ve talked about it, they have made it clear better content will always win.

These Core Web Vitals are merely a tiebreaker.

Kurt Elster: Tiebreaker.

Paul Reda: Where they were like, “Maybe the Core Web Vitals will help you rank one slot higher because it was a tiebreaker.” You will not be delisted or lose your Google rankings at all. But if you do this thing this guy did, you might be delisted.

Kurt Elster: Oh, okay. So, ultimately, we have this score that’s making people crazy. Whether we like it or not.

Paul Reda: And we’ve made 12 podcasts about it and how we hate it.

Kurt Elster: Yes. And also, a testing tool that makes fun of it. We have our own speed test tool that just gives you 110 out of 100 every time. It’s funny. But I get why people are panicked. If you get any kind of organic search, the implication that like, “Well, if your website’s not scoring well…” And hey, that score reads like an F when you see like 30 out of 100. In your head, you just go, “I failed. That’s an F.” And so, they want a faster site. I don’t blame them. But there’s so many merchants clamoring for faster sites, so many webmasters clamoring for faster sites, that there are plenty of people who are willing to take your money and help you get a faster site. And that, it seems, has become a slight issue here.

So, walk me through. What’s going on here?

Paul Reda: Wait. I just want to roll it back for one second. I found the relevant piece of text directly from Google. While all of the components of page experience are important, we will prioritize pages with the best information overall, even if some aspects of page experience are subpar. A good page experience doesn’t override having great, relevant content. However, in cases where there are multiple pages that have similar content, page experience becomes more important for visibility.

Kurt Elster: It’s a tiebreaker.

Paul Reda: It’s a tiebreaker. They-

Kurt Elster: That is such a good way to phrase it.

Paul Reda: And they said “may.” There was a different section where they said it where they were like, “It might rank help you and might rank better.” So, it’s not even a yes.

Kurt Elster: Those are some weasel words there.

Paul Reda: Yeah. So, what happened here is our client came to us and was like… He was very proud of himself. He was like, “Check this shit out. I hired this guy to increase my Google PageSpeed score and lo and behold, he increased my Google PageSpeed score.” The Google PageSpeed toolset is called Lighthouse. And so, he was really proud, and we checked it out. His Google PageSpeed score is something ridiculous. It’s like 92 or 93.

Kurt Elster: Well, I tried it today. It said 78 out of 100.

Paul Reda: On mobile?

Kurt Elster: On mobile.

Paul Reda: And then it’s like 90-something out of…

Kurt Elster: 100 on desktop.

Paul Reda: On desktop. Yeah.

Kurt Elster: And in the past, you know, when you would run this test on that site prior to these changes, do you have that score?

Paul Reda: I mean, I don’t. I don’t have the exact score up off the top of my head, but nine times out of 10 Shopify stores are under 25.

Kurt Elster: It’s usually… Yeah, like-

Paul Reda: They’re usually even in the teens.

Kurt Elster: When I see 35, I’m like, “Wow. You did a good job here.”

Paul Reda: 35 would be nuts for me to see for a Shopify store. And I mean, again, we have multimillion-dollar clients who makes tens of millions of dollars a year and their PageSpeed scores are like 12.

Kurt Elster: Yeah. Yes. No, all our stores that do… periodically seven figures in a month, all of them have PageSpeed scores 10 to 15.

Paul Reda: Yeah.

Kurt Elster: That’s where the real high performers are. And the best part is Shopify has that card and it’ll be like, “You’re ranking the same as 96% of stores similar to you.” So, you know that’s just kind of how those high performing stores go.

Paul Reda: And again, to repeat, the actual speed of their actual pages, as loaded by users, are very quick. It’s just the weird, arbitrary score that PageSpeed gives you is bad. The actual speed of the pages, an important metric, is fine.

Kurt Elster: And I’m not saying like we shouldn’t care that pages should be slow or fast. I want a faster site.

Paul Reda: Pages should be fast. No.

Kurt Elster: I don’t want to be sitting, waiting for a site to load. I don’t.

Paul Reda: It’s important. So, anyways, so I got annoyed that I was like, “How did this pull this off?” Because it smelled funny to me. It was too fast. It smelled funny.

Kurt Elster: It didn’t smell funny to me. I saw it as an opportunity. I said, “Oh my gosh. Someone cracked the code. Someone did it! And I can think of 20 people who would immediately yell, “Take my money,” to have us implement this same optimization.” I would love to be able to go to people and say, “Hey, how do you do this?” And so, you’re digging through this thing. You’re sleuthing.

Paul Reda: Yeah.

Kurt Elster: I want a faster site. Tell me how to do it.

Paul Reda: Oh, yeah. Okay. Well, here’s what you do. You cheat. So, I’m going through the code and there’s just a giant block of code that’s encoded in Hex.

Kurt Elster: Tell me what that means.

Paul Reda: And what Hex is, you know, you think about letters to convey information, like ABCDEF. There’s different ways of rendering those letters in web code and one of the ways of doing it is Hex, and Hex has a bigger space, so there’s like more symbols are Hex encoded. Emojis are like Hex encoded. It’s more than just the 26 letters of the alphabet. Does the alphabet have 26 letters?

Kurt Elster: Yes. Actually, this is top of mind, because my four-year-old is like super into her letters right now.

Paul Reda: Okay, so when you think of the alphabet, you only get 26 letters, but when you have Hex, you have hundreds or thousands of letters.

Kurt Elster: Because it’s all our special characters, so when I’m looking at a letter on the web, it can actually be rep… It’s not represented by the letter, necessarily. It could be represented by a Hex value, which is like how many characters?

Paul Reda: Which is like four characters. It’s like /X57 or whatever. Something like that.

Kurt Elster: So, how does making my website’s code physically larger by obfuscating it in Hex help me?

Paul Reda: He wrote it in Hex so when a human looked at it, it made no sense. And so, I was like, okay, well, guess I’m gonna be translating all this Hex now, so I translated all the Hex into actual alphanumerics as we would know, and started reading what it was doing, and the other thing he did was everything that was like a variable, or like the name of a function that the script was doing was just gobbledygook code. Because again, the machine doesn’t care. If I’m writing a code and it does something like make the image smaller, I’ll just call the function image smaller, so I know exactly what… Oh, this thing makes the images smaller, because I called it image smaller.

But you know, one of the main ones here is called… 0X5C56X9 is the name of one of the functions.

Kurt Elster: More obfuscation.

Paul Reda: More obfuscation.

Kurt Elster: I struggle with it too. I was amazed I got it right.

Paul Reda: Oh my God. But, I mean the computer doesn’t care that it’s called that. But any person reading it is just gonna… Their eyes are gonna glaze over. So, what he does in the end is he uses Liquid code to-

Kurt Elster: That’s Shopify’s theme language.

Paul Reda: Shopify’s theme language. He uses Liquid code to overwrite every single piece of JavaScript on the website. And so, he can control that piece of JavaScript now.

Kurt Elster: To what end?

Paul Reda: He makes it defer. There’s different ways to load the scripts. You put in defer, you put in async, so it loads asynchronously, like-

Kurt Elster: With just a pipe filter.

Paul Reda: Yeah. He wrote an insane… Liquid you can use to replace things, so it’s like anytime you find the word script, add the word butts on the end of it, or whatever. You can do that.

Kurt Elster: Script butts.

Paul Reda: Script butts. And so, he’s doing that, but he’s doing everything he can, he wrote this insane system, so whether it was in theme code, whether it’s created by an app, like wherever it is on the store, it searches through that store and makes it load later. Do not load.

Kurt Elster: Okay, that part, that’s legit.

Paul Reda: It is, and it isn’t, because some of that stuff, you need it when you’re loading that page.

Kurt Elster: So, the issue is that it’s just… This is a broad brush.

Paul Reda: He’s got a claymore and he’s just hacking at all of them. It’s not a rapier. He’s just slicing every single script. So, this Liquid just does a brute force thing. And then the Liquid also… and he doesn’t run the Liquid if you’re in the theme editor or if you’re on the cart page.

Kurt Elster: Okay.

Paul Reda: In order to guarantee that the theme editor loads and works right.

Kurt Elster: So, he’s aware that this can create issues.

Paul Reda: Yeah. This can create issues. Then he runs a function called exec speed, and it was actually called exec speed, and what exec speed does is anytime you interact with the page whatsoever, or four seconds after the page loads, it finds all those pieces of JavaScript and shoves them out the door and says, “Let’s go. We need those.” So, the page ends up working correctly, because anytime you scroll, or click on anything, or move, or do anything, exec speed immediately shoves-

Kurt Elster: Wait. Hold on. So, all my JavaScript doesn’t execute until four seconds after the site has loaded?

Paul Reda: Until the load event happens, which means like… There are different events in the course of the load of a webpage and the load is like, “All right, I’ve read everything I need to read, but I’m still working on doing all of it, but I have all my instructions of what I need to do.”

Kurt Elster: Okay.

Paul Reda: Again, no, four seconds after the load or if you click on anything, scroll at all, or interact or touch anything or interact with the page whatsoever.

Kurt Elster: This feels like it would break a lot of functions, apps, et cetera.

Paul Reda: It doesn’t because if you do anything whatsoever, it loads it up, or four seconds after the page load if you’re just staring at the screen. I mean, four seconds after the page load in general is probably when the page has completely finished loading if you have a good page. So, it’s really invisible to the naked eye.

Kurt Elster: Okay.

Paul Reda: So-

Kurt Elster: So, this part is or isn’t legitimate?

Paul Reda: I mean, it works.

Kurt Elster: Okay. It’s just aggressive?

Paul Reda: Here’s the thing. So, we’re using Liquid code, which happens first. That happens on Shopify’s side. The JavaScript runs in the browser. That happens after the Liquid code’s been generated. So, he uses Liquid to hide all the JavaScript, then uses exec speed to push all the scripts. If he detects you are the Google Lighthouse browser, exec speed never runs.

Sound Board: Sad trombone sound.

Kurt Elster: All right. I think I know what the end result here would be. Walk me through what that would do functionally.

Paul Reda: It makes your Google PageSpeed score go through the roof because it’s not loading any scripts whatsoever. But the actual site that would be created by doing that is… I will say this client in question does not have a lot of stuff running on his website that’s like script-based, so it’s really not too bad, but his product photos are totally jacked. It does not create a usable website. So, he’s giving Google PageSpeed an unusable website that gets a good Google PageSpeed score.

Kurt Elster: How does that work?

Paul Reda: What do you mean how? All Google PageSpeed goes was, “All right, did it complete loading? All right, good. I’m done.”

Kurt Elster: Okay, so Google PageSpeed, because it’s not a human…

Paul Reda: It’s not a human that’s using the website.

Kurt Elster: It’s a robot. It’s trusting the browser or their user agent, which is equivalent to a browser. They’re trusting it to understand, to just accept that when the page says it’s done loading, it’s done loading.

Paul Reda: Yeah.

Kurt Elster: All right, so then what’s happening here is JavaScript from apps really is the culprit.

Paul Reda: It’s the third-party scripts, and yeah, the scripts that you’re loading, and especially the app scripts because the apps are not on the Shopify CDN.

Kurt Elster: And Google really dings you for that.

Paul Reda: Well, and it’s wherever they’re coming from, so if they have a cut rate server that’s sending you some JavaScript file, it takes a while to get there. I mean, it has to execute the JavaScript, too. It takes… The browser has to execute the JavaScript. That’s more work on its-

Kurt Elster: All right, so this guy’s obfuscated script-

Paul Reda: Don’t worry. Your daughter is not being murdered right now I don’t think.

Kurt Elster: Yeah, she’s clear… Well, we’re four now, and we have some pretty epic tantrums. So, what this script does when it… It looks for is Google Lighthouse, so the PageSpeed Insights tool-

Paul Reda: I faked my browser user agent and said, “I’m Google Lighthouse,” and then I loaded the page to see what was happening.

Kurt Elster: And what happened?

Paul Reda: It never loaded any of the scripts. I’ll tell you right now. So, normally there’s… JavaScript is 64 of their requests. It ends up being 6 megs of resources on this site normally.

Kurt Elster: 6 megs. Oh my gosh.

Paul Reda: I know. Yeah, it sucks. When I say that I’m Lighthouse, JavaScript is only 9 requests and 730K of resources.

Kurt Elster: All right, so a majority of the page load just disappears.

Paul Reda: Yes.

Kurt Elster: If the script sees-

Paul Reda: The page load goes from… Well, transferred, it’s because it comes over zipped, so let’s say transferred. Transferred it was 1.8 megs of script becoming 1.93K of script. The total website is 3.8 transferred. The total website to Lighthouse is only 2 transferred.

Kurt Elster: This script sniffs out Google’s PageSpeed tools and when it sees them, it strips all of the JavaScript out of the site, so it serves to Google a stripped down, unusable website, but in doing so-

Paul Reda: Gives you a good score.

Kurt Elster: Rams the PageSpeed score through the roof.

Paul Reda: It literally is, “I want to get an A in this class.” Okay, how do you get the A in the class? Well, I hacked into the terminal and changed my grade to an A. I got an A in the class.

Kurt Elster: All right, so-

Paul Reda: You didn’t learn anything.

Kurt Elster: And the reason we want a high PageSpeed score is so that we win the tiebreaker potentially in search results, right?

Paul Reda: I guess. Even though, again-

Kurt Elster: This has not actually been implemented.

Paul Reda: This has not been implemented. It makes me feel good. It’s the reason we made the PageSpeed tool. It makes me feel good. I have a good score.

Kurt Elster: I got a good grade.

Paul Reda: It said I was a good boy. Yeah.

Kurt Elster: I was a good boy. Sergey Brin patted me on the head. Thank you, Larry Page. My understanding-

Paul Reda: Here’s the best part, though.

Kurt Elster: Oh, it gets better?

Paul Reda: The actual… So, for the actual users, so I ran… I did a lot of testing last night. I ran it with this PageSpeed, ran the site with these PageSpeed changes, did a bunch of tests, and then ran it without the PageSpeed changes, did a bunch of tests. This guy’s stuff made the PageSpeed score better, makes the website load slower. So, it’s worse for actual users, but your PageSpeed score is higher now.

Kurt Elster: That’s quite the deal with the devil.

Paul Reda: Yeah. I mean, the site is-

Kurt Elster: They’re like, “Look, you said you wanted a higher PageSpeed score, and I delivered.”

Paul Reda: I mean, if I had a… I’m not sure why, but I think what happens is there’s stuff that actually is async and deferred that in the normal course of human events would not be loaded, but when exec speed runs and goes, “All of you, get out the door,” stuff gets loaded that normally wouldn’t have gotten loaded. So, it ends up being 25% bigger. The page is 25% bigger to make the PageSpeed score slower.

Kurt Elster: Wow.

Paul Reda: Yep.

Kurt Elster: And the merchant doesn’t know.

Paul Reda: Merchant doesn’t know. All completely hidden. Hidden code. No human could read it. I had to spend… I spent a day a week ago and then all last evening figuring out what this thing did.

Kurt Elster: Wow.

Paul Reda: But don’t worry, I’m sure he paid this guy thousands of dollars and the guy said, “Look, your score is bigger now.” He’s making bank.

Kurt Elster: There was another interesting thing in this code. When we initially… We didn’t know what it did. You had tried just shoving it onto a different store.

Paul Reda: Well-

Kurt Elster: Into a test store.

Paul Reda: Well, the thing in the Hex code is this guy checks to see. He’s really worried. He checks to see what domain… He hard codes your domain.

Kurt Elster: So, if my site is example.com, it checks to make sure I’m example.com.

Paul Reda: It’s being loaded on example.com. And what it does is if it’s… and you can’t tell what this is because it’s all Hex encoded, so if you don’t translate the Hex code, you have no idea what this is. If you copy that code and put it on notexample.com, it breaks your site. But if you load that site in PageSpeed, it loads fine.

Kurt Elster: Oh, geez.

Paul Reda: So, take the code, you’re like, “Oh, I’ll tell you what. I heard this guy, he jacked up my PageSpeed score, I’ll give you the code snippet. You put it on your site too and you’ll have a great PageSpeed score too.” You do it, you put it on your website, you check your PageSpeed score on your website, it’s great now. It is. It’s 90 now. I’m doing a great job. But your actual website will not load anymore.

Kurt Elster: Oh, man. What other things did this guy do to cover his tracks?

Paul Reda: I mean, that’s pretty much it. I mean, he wrote it in a language that no human would be able to read, that you have to care… You have to look at this, care about it, and sit down and focus on what exactly it is.

Kurt Elster: Didn’t you say it checks to see if you’re in the Shopify theme editor and then just doesn’t run, so that it doesn’t break anything?

Paul Reda: Yeah. Well, yeah. It doesn’t run exec speed or anything if you’re in the theme editor.

Kurt Elster: Oh, man.

Paul Reda: Yeah.

Kurt Elster: I would love to know what this guy’s charging. And I asked, too. I said like, “Hey, do you know what he did?” And he sent me the change log and it was just like, “I made your website faster.” And it was suspicious that the things he listed were just the most basic, standard stuff.

Paul Reda: Oh, he listed more changes?

Kurt Elster: He said, he’s like, “Oh, I minified and concatenated your CSS and JavaScript and HTML,” which he didn’t do.

Paul Reda: He didn’t do that. No, he has one snippet. It’s called vital scripts. It’s vitalscripts.liquid. He pastes vitalscripts.liquid into your store and that’s it and he walks away. Once he wrote that, once he wrote the script, I mean, obviously there was a lot of work behind getting this fucking nightmare scenario thing all set up, but once he has it now, he posts it in your store, it’s five minutes of work.

Kurt Elster: The suspicious part was when the guy was like, “Well, here’s what he did for me.” And it was like four things that were incredibly basic and did in no… and it’s all stuff we’ve done many times, so I knew that those changes would not result in the PageSpeed scores we were seeing.

Paul Reda: Yeah.

Kurt Elster: And I thought, “Well, that’s strange.” I’m like, “Maybe he just… there’s some secret sauce and he just didn’t tell us.”

Paul Reda: Well, yeah. He’s not gonna tell the client, because like the client’s not gonna understand anyway.

Kurt Elster: They don’t care anyway.

Paul Reda: Yeah.

Kurt Elster: He got the result. They’re happy with the result. They want the outcome. And so, he delivered on the outcome.

Paul Reda: He did.

Kurt Elster: By making the page load size bigger and making the site unreliable. And gaming Google.

Paul Reda: That’s the thing.

Kurt Elster: That’s how you get delisted.

Paul Reda: I mean, I swear, if Google sniffed this out, and I mean, it’s straight up in there. It’s like it’s a JavaScript if and it’s if user agent contains Lightspeed, and then it does all this shit. I mean, he’s not hiding it. So, I mean, if Google figures out that you’re doing that, you will get delisted. They hate that shit.

Kurt Elster: Yeah. Don’t. Don’t mess around with Google. No black hat. They don’t like that.

Paul Reda: It’s crazy, though. I can turn it on and off. I have it saved in my browser. I just change my browser user agent and I’m just like, “Look at that. Now it’s broken. Look at that. Now it’s fine.”

Kurt Elster: Oh, geez.

Paul Reda: The only thing that changed is the word Lightspeed was in my user agent.

Kurt Elster: Oh, man. I wonder how often this goes on. Because we’ve seen other stores where they’re like, “Yeah, why is everyone complaining? It’s so easy to get a good PageSpeed score and I didn’t have to change anything and now I get 99 out of 100.” And you look at the store and you test it, 99 out of 100. But the store otherwise seems completely normal and fine, where you’re like, “What? What am I missing here?”

Paul Reda: Yeah.

Kurt Elster: And the answer is they’re cheating on the test.

Paul Reda: Pretty much.

Kurt Elster: By sniffing out the Lighthouse user agent.

Paul Reda: Yep.

Kurt Elster: Oh, wow.

Paul Reda: Yeah. I mean, it was… and we thought it was something different. We thought when we were initially looking at it, we were focusing on that four second delay, and we thought it was a thing where it was like it was delaying all the scripts by four seconds so Lightspeed never loaded them, so Lightspeed never scored them. No, it’s not that at all. It rips all the scripts away and then if it determines you’re a normal person, it shoves all the scripts at you.

Kurt Elster: Geez. I do like the idea… All right, so this is all… I was gonna be like, well, you know, let’s talk this through. Is this a legitimate idea? Because you increase… It only occurs on… This is a horrible idea.

Paul Reda: I mean, it’s a dumb idea, because first of all, it made his site slower. I mean, the size of the site was literally 20% bigger.

Kurt Elster: It’s amoral, it’s unethical, it’s fraudulent, I don’t like any of this.

Paul Reda: Well, I don’t care. I mean, it’s like-

Kurt Elster: You beat the PageSpeed test. They’re not like a government body.

Paul Reda: I’m not crying any tears because he’s acting unethically towards Google, like, “Oh, no. Oh, Sergei.” It’s more like you’ve made yourself… You’ve done a complete placebo effect where you’re like, “My PageSpeed score is better now. It’s a bright, shiny day.” Doesn’t make any difference, dude. You’ve made your page slower for the people that actually buy things and if the day ever comes that Google sniffs out you’re doing this, they’re gonna take your website off the internet.

Sound Board: You sit on a throne of lies.

Paul Reda: All right, that was a good one.

Kurt Elster: Oh.

Paul Reda: Yeah. That’s good. You were like, “How can we do this? Can we figure out a way to do this?” I was like, “Yeah. I’ve come here to tell you I figured out how we can do this, and we can do it now if you’d like.”

Kurt Elster: You know, why is it worse when you agree with me?

Paul Reda: I love it.

Kurt Elster: Oh, man. All right. Well, as usual, impressive sleuthing.

Paul Reda: Thank you.

Kurt Elster: Yeah. That was really good.

Paul Reda: I was feeling good. Yeah, like my wife was trying to talk to me and I was like, “Listen, a thing happened, and I’ve been trying to figure it out. Leave me-“

Kurt Elster: Somewhere, someone’s wrong on the internet.

Paul Reda: I was like, “Leave me alone.”

Kurt Elster: Is there anything legitimate here that we can take from this?

Paul Reda: I don’t know. It’s just because PageSpeed doesn’t make any sense to me. I really don’t get it. Maybe I’m stupid. Maybe I’m stupid. But they’re like… I read through the report and it’s always like, “Well, stop… Defer these render-blocking agents.” And then the render-blocking agents is always like the CSS file that the website runs on. And it’s like the cart script, so Shopify’s cart works. It’s like I’m not going to defer or not load those things. We need them.

Kurt Elster: Yeah. But they still… They ding you for it. Or my favorite is that they appear to penalize you for the use of a CDN.

Paul Reda: I love that they’re always like, “Quit loading…” Their main piece of JavaScript that they’re always like, “Quit loading this giant, horrible piece of JavaScript from a third-party website, this is wrecking your PageSpeed score.” And it’s always the YouTube script. They’re like, “Don’t…” You’re going too far now. Yeah, they’re always mad that you’re using YouTube on your website. It’s like one hand doesn’t know what the other… It’s like, “You own YouTube. You made the script that big.”

Kurt Elster: Yeah. What’s funny is-

Paul Reda: It’s like maybe if you made the YouTube script not like a meg, it’d be better.

Kurt Elster: Which would be better for your PageSpeed score? Embed a YouTube video or embed an HTML5 MP4?

Paul Reda: Oh, HTML5 all day long will be better for your… One of the main ways you could help your PageSpeed score is stop using Google’s YouTube service.

Kurt Elster: But what’s funny about that is in practice, just about every device on the planet has that YouTube JavaScript cached, so it’s not gonna load it.

Paul Reda: Yeah. Because you’ve gone to YouTube at some point in the last three months, so you already got it.

Kurt Elster: But they’re still gonna ding you for it.

Paul Reda: Yeah.

Kurt Elster: So, you should get that file to under… Get that video to under 20 megs, upload it to Shopify files, and just shove that right in the page. That will get you a better PageSpeed score by loading a much larger page.

Paul Reda: Yes.

Kurt Elster: Yeah. But I mean that… You put a cover photo on it, and it defers, or it loads async. Actually, it works pretty well, but it is fun to tweet Google about PageSpeed’s strange idiosyncrasies.

Paul Reda: The finished time without this hack on the site was 11 seconds. And again, finish is like literally the last thing at the bottom of the page that was like the chat widget or whatever. The page was useful way before 11 seconds. But with this Lightspeed hack, the finished time was four seconds, because he’s just…

Kurt Elster: A whole lot of stuff goes away.

Paul Reda: He’s just not loading it. And again, who cares if the site works, because no human will interact with it.

Kurt Elster: The part I like, I do like using a pipe filter on the content for header tag in the theme.

Paul Reda: That was diabolical. He really thought his way through. He’s like replacing things inside every single script to find a way to make that script load later and later in the stack. He’s like replacing the actual third-party scripts.

Kurt Elster: The truth is this entire thing’s incredibly clever.

Paul Reda: It’s super clever.

Kurt Elster: It’s just wildly misguided.

Paul Reda: Yeah. It’s just a scam.

Kurt Elster: And we know it’s fraudulent because he… None of this was mentioned to the client and he misrepresented the work.

Paul Reda: Yeah.

Kurt Elster: He said like, “Well, I minified this and concatenated that.” He didn’t actually do any of that work.

Paul Reda: I mean, on the one hand he could just be like, “Listen, you want to con Google PageSpeed? I can con Google PageSpeed.”

Kurt Elster: That would be different.

Paul Reda: That would be different. He knows he’s doing… He has the… What’s it called? He’s got the mens rea. He knows he’s guilty. He knows he’s guilty of doing a bad thing because he’s not telling anyone about it.

Kurt Elster: Yes. Yeah. He’s covering his tracks and that’s the smoking gun. As soon as that thing-

Paul Reda: If he was just like, “What? I just thought I was doing a cool thing and screwing Google over.” Cool, why’d you hide it so much?

Kurt Elster: Yeah. As soon as you said, “Hey, this JavaScript’s obfuscated.” I thought, “Well, maybe he’s paranoid.” And then you said, “Hey, it’s sniffing for the Lighthouse user agent.” And that’s when the alarm bells were going off, like, “Huh oh.” And yeah, wow, excellent, excellent research.

Paul Reda: Thank you. I’m pleased with myself.

Kurt Elster: Is there anything legitimate one can do to improve their PageSpeed score? Uninstall all of your apps. Stop using Google fonts entirely.

Paul Reda: The main way to get a 100 Google PageSpeed score is to visit PaulReda.com and look at that website and make your website like that. And you’ll get a 100 PageSpeed score.

Kurt Elster: Your website is largely plain text on a white background. No images.

Paul Reda: It’s a white background with three P tags. Three paragraphs with text. Of bare text.

Kurt Elster: And you score 100 of 100.

Paul Reda: And I get 100 of 100.

Kurt Elster: On mobile and desktop?

Paul Reda: On mobile and desktop. Now, I don’t think I will be doing a million dollars a month on my website, so if you want to do a million dollars a month on your Shopify store, maybe you need to deal with the fact that you won’t get a good PageSpeed score.

Kurt Elster: I mean, it’s just the reality of it.

Paul Reda: And the thing is, the worst part is so I get a 100 PageSpeed score, I called my mortgage company, and they would not accept my 100 PageSpeed score to pay my mortgage, but they would accept the million dollars a month I would make on my Shopify store, so I decided to go with that because apparently PageSpeed scores don’t pay the mortgage.

Kurt Elster: Really?

Paul Reda: Yeah. They don’t.

Kurt Elster: Wow. You don’t say. So, is there anything legitimate I can do here?

Paul Reda: No. We’re done. I’m done. I don’t talk about PageSpeed anymore.

Kurt Elster: Oh, okay. Well, all right, here’s a better question.

Paul Reda: If you come to us with your PageSpeed score as a client, my feeling is you’re fired.

Kurt Elster: Oh, geez.

Paul Reda: Go away.

Kurt Elster: Well, all right, what if you paid some guy and in a suspiciously quick time he made your website much, much faster in PageSpeed?

Paul Reda: Not in reality. Again, I have to reiterate. People attack us for this. They’re like, “They say that websites should be slow.”

Kurt Elster: I know! I hate the way we get… When we’re like, “Hey, PageSpeed sucks.” It gets mischaracterized as like, “Well, I disagree with Kurt and Paul because I think websites should be fast.” I think they should be fast, too!

Paul Reda: Well, the problem is is-

Kurt Elster: PageSpeed sucks, though.

Paul Reda: The problem is it’s called PageSpeed. If I was like Windows sucks and they’re like, “Paul wants to live in a basement.” That’s not… I wasn’t talking about that windows, I was talking about the other Windows.

Kurt Elster: Yeah. We’re talking about the tool. The actual testing tool. All right, so let’s say I hired a guy, and now my PageSpeed score is suspiciously good. How do I verify that I have not been bamboozled? I think that’s what I want to close with.

Paul Reda: I mean, I guess… What’s it called?

Kurt Elster: Well, how did you… Is there a practical way to do the user agent test the way you did?

Paul Reda: Well, if people… Here’s the thing. It involves using the Google Inspect Element tool and the network tab in the Inspect Element tool. If you’re smart enough to use the Google developer tools and use the network tab, you can check your own website speed yourself. It tells you how fast everything loads on your website, the biggest files on your website, how big your website is, all that stuff. Screw PageSpeed. It’ll tell you right there in your own damn browser.

But that’s how you do it. You have to go in that network tab, and you can change your user agent in there.

Kurt Elster: Okay. I accept this. When I talk to people who are legitimate and performance optimize Shopify themes, the answer is always the same. They’re like, “Uninstall as many apps and scripts as you can, as is reasonable, because you can’t get rid of all of them, and make sure you’re not loading gigantic images.” Resize your images is number two.

Paul Reda: That’s moot now, especially for our Turbo clients, because Turbo uses a thing called source set in JavaScript, where it looks to see the size of the box that the image is appearing in, and then calls the size of the image that is appropriate for that box. So, no more like 100 x 100 images that are on the page, but then when you look at the image it’s actually 3,000 x 3,000. That doesn’t happen anymore.

Kurt Elster: So, really-

Paul Reda: It’s all apps now. That’s the only thing that can fuck your site speed now, or make it better, or whatever. It’s all third-party apps or tracking things or whatever you’ve jammed in the footer. That’s the whole bit. That’s the whole ballgame.

Kurt Elster: You’re right. I know you’re 100% right. But nobody wants to hear it because they don’t want to get… I don’t want to give up all my apps. I don’t want to give up all my tracking scripts.

Paul Reda: Well, and again-

Kurt Elster: And I want my PageSpeed score to go up.

Paul Reda: It’s just like if it makes the PageSpeed score go down by 10 points, but it increased revenue by 20%. Again, which would you rather have here?

Kurt Elster: Yeah, do you want the money or the PageSpeed score?

Paul Reda: Yeah. It’s like, “Oh, well, it increased my page load by 500K.” Well, if increasing your page load by 500K ended up making you an extra 500 grand, again, the 500 grand wins.

Kurt Elster: Yeah. Take that deal.

Paul Reda: Speed is important but it’s getting very close to being a solved issue.

Kurt Elster: I think the one nice thing about it being such a top-of-mind issue for so many merchants is that means it’s going to get attention. And that means… We already know Shopify is taking it seriously. We know they’re implementing things to try and change things and I hope when sectioned themes roll out, when it happens… It’s gonna happen! It’s happening! No, I have no official word whatsoever. I have no idea. I just… It’s something I really, really want, and so I think as part of that we are going to see a focus and improvement on performance. I hope, I think, that is my best wishes. Anything else you’d like to go out on, good sir? That was phenomenal.

Paul Reda: That’s pretty much it. I’m feeling good about myself. It’s a beautiful day outside. You have a weird, smelly old car that doesn’t work. So, we’re living our best lives.

Kurt Elster: Absolutely. Let’s get out of here.

Sound Board Bill & Ted: Excellent!

Paul Reda: Oh my God.