Slide 1

Slide 1 text

Infoshare, Gdańsk – May 2023 My Website Is Slow! 
 Where Do I Start? Harry Roberts – @csswizardry

Slide 2

Slide 2 text

Hi There! I’m Harry. Consultant Web Performance Engineer Leeds, UK @csswizardry speakerdeck.com/csswizardry

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

“How do we know site speed is suffering? Customer complaints? Competitor benchmarking? Internal monitoring?”

Slide 5

Slide 5 text

Where do I start?!

Slide 6

Slide 6 text

Guess

Slide 7

Slide 7 text

Guess Please don’t do this. This is a terrible idea. I would not recommend that at all I actually used to do this. Click around the site until I happened upon an issue. Day one was paralysing. Sure, I could make educated guesses. But any guess is not ideal.

Slide 8

Slide 8 text

Client-Supplied URLs

Slide 9

Slide 9 text

“Can you provide a list of key pages or flows for me to look at?”

Slide 10

Slide 10 text

“Are there any parts of the site to avoid completely?”

Slide 11

Slide 11 text

Client-Supplied URLs Let them do the work… They know their website better than I do—they tell me! Let’s think a level up from pages. Representative page types/templates. There are still going to be some blind spots. But this is the easiest place to start.

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Home: https://www.apple.com/ Product: https://www.apple.com/iphone/ Model: https://www.apple.com/iphone-14-pro/ PDP: https://www.apple.com/shop/buy-iphone/iphone-14-pro SRP: https://www.apple.com/us/search/airtag

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Site-Speed Topography

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

Glossary JFC, WTF?! ATF: Above the Fold CLS: Cumulative Layout Shift CrUX: Chrome User eXperience Report CWV: Core Web Vital FCP: First Contentful Paint FP/SR: First Paint/Start Render GA: Google Analytics LCP: Largest Contentful Paint P: th Percentile PDP: Product Details Page S(E)RP: Search (Engine) Results Page SI: Speed Index TBT: Total Blocking Time TTFB: Time to First Byte

Slide 21

Slide 21 text

“The physical appearance of 
 the natural features of an area of land, 
 especially the shape of its surface.”

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Clusters of Red or Green Overall page health. Horizontal runs of red show the page performs poorly in many areas. Green shows the opposite. Red at the start (TTFB) usually means red later on (e.g. LCP).

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

Green to Red Good to bad… Vertically, how do individual metrics perform? Patterns usually emerge, but does anything buck the trend?

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Variability Our most troublesome metrics TTFB is our most stable metric. LCP is our most volatile. Highlights potential underlying differences between page types. The same metric being highly variable usually has significant causes.

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Implied Issues Shortcuts Delta between TTFB and FCP is render-blocking resources (i.e. your ). Delta between FCP and LCP is inefficient LCP candidates (e.g. lazy-loaded). Positive delta between SI and LCP is late-loaded ATF content. Positive delta between FP and FCP may be web-font problems. Highly prone to false-positives—double check everything.

Slide 30

Slide 30 text

Questions What does it imply? Home and Product pages generally healthy; PDP and SRP are generally poor. Home page has great FCP but the worst LCP—lazy-loaded image? SRP has the worst TTFB—expensive/inefficient queries? Why does the model page have the best LCP but the worst SI? Why are the PDP and SRP so slow to start render? SRP has the worst CLS—is it client rendered?

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

Why is the homepage LCP so slow?

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

Why is SRP first-byte so slow?

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

Why does the Model page have poor SI?

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

Largest != most important.

Slide 39

Slide 39 text

speakerdeck.com/csswizardry/lcp

Slide 40

Slide 40 text

Why does the PDP shift so much?

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

Why does the SRP shift so much?

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

Why are the PDP and SRP so much slower?

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

https://www.apple.com/ https://www.apple.com/iphone/ https://www.apple.com/iphone-14-pro/ https://www.apple.com/shop/buy-iphone/iphone-14-pro https://www.apple.com/us/search/airtag

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

Slide 49

Slide 49 text

Problem: That was all based on assumptions.

Slide 50

Slide 50 text

URLs Location Device type Network conditions

Slide 51

Slide 51 text

URL Problem? Solution

Slide 52

Slide 52 text

— unsplash.com/photos/nEJmnfCCPmI

Slide 53

Slide 53 text

Google Analytics

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

Behavior » Site Speed » Overview

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

Problem: Load times from every page in every country in every browser on every device type, averaged.

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

Behavior » Site Speed » Page Timings

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

Problem: Load times from every page in every country in every browser on every device type, averaged.

Slide 66

Slide 66 text

Site Speed is not a number.

Slide 67

Slide 67 text

Site Speed is not a number.

Slide 68

Slide 68 text

… » Site Speed » Page Timings » Distribution

Slide 69

Slide 69 text

30.26 + 46.40 = 76.66%

Slide 70

Slide 70 text

94.8%

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

Slide 73

Slide 73 text

Problem: This will be gone on 1 July 2023

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

Chrome User eXperience Report

Slide 77

Slide 77 text

developer.chrome.com/docs/crux

Slide 78

Slide 78 text

— developer.chrome.com/docs/crux/about/ “The Chrome User Experience Report [CrUX] is a dataset that reflects how real-world Chrome users experience popular destinations on the web.”

Slide 79

Slide 79 text

Problem: Only captures Chrome traffic; only captures Core Web Vitals.

Slide 80

Slide 80 text

pagespeed.web.dev

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

CrUX API

Slide 83

Slide 83 text

$ curl -s --request POST 'https:// 
 chromeuxreport.googleapis.com/v1/records:queryRecord? 
 key=' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{"formFactor":"PHONE","url":"https:// 
 www.apple.com/shop/buy-iphone/iphone-14-pro","metrics": 
 ["largest_contentful_paint", "first_input_delay", 
 "cumulative_layout_shift"]}'

Slide 84

Slide 84 text

"largest_contentful_paint": { "histogram": [ { "start": 0, "end": 2500, "density": 0.37880096751900411 }, { "start": 2500, "end": 4000, "density": 0.31850380096751846 }, { "start": 4000, "density": 0.30269523151347738 } ], "percentiles": { "p75": 4374 } } ...

Slide 85

Slide 85 text

Problem: You still need to decide the URLs.

Slide 86

Slide 86 text

Problem: You need to graph the data.

Slide 87

Slide 87 text

Treo

Slide 88

Slide 88 text

#notAnAd

Slide 89

Slide 89 text

No content

Slide 90

Slide 90 text

No content

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

No content

Slide 95

Slide 95 text

No content

Slide 96

Slide 96 text

Not one of those URLs was in our initial list!

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

No content

Slide 99

Slide 99 text

Back to WebPageTest!

Slide 100

Slide 100 text

Search Console

Slide 101

Slide 101 text

search.google.com

Slide 102

Slide 102 text

Insights on a plate.

Slide 103

Slide 103 text

Search Console » Core web vitals

Slide 104

Slide 104 text

No content

Slide 105

Slide 105 text

No content

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

URL Groups

Slide 108

Slide 108 text

www.site.com

Slide 109

Slide 109 text

www.site.com/forum/

Slide 110

Slide 110 text

www.site.com/forum/ } } Good Poor

Slide 111

Slide 111 text

No content

Slide 112

Slide 112 text

No content

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

URL Groups are a bit of a mess…

Slide 115

Slide 115 text

No content

Slide 116

Slide 116 text

Back to WebPageTest!

Slide 117

Slide 117 text

Summary

Slide 118

Slide 118 text

URL Problem? Solution

Slide 119

Slide 119 text

Gather data from various sources.

Slide 120

Slide 120 text

Use smart shortcuts.

Slide 121

Slide 121 text

Use new insights to inform future testing.

Slide 122

Slide 122 text

Go looking for trouble.

Slide 123

Slide 123 text

Problem URL Solution

Slide 124

Slide 124 text

speakerdeck.com/csswizardry Thank You harry.is/for-hire