Performance Mistakes
…an HTTP Archive Deep Dive
Performance Architect @ Etsy
Paul Calvano
https://bsky.app/profile/paulcalvano.bsky.social
https://www.linkedin.com/in/paulcalvano/
https://webperf.social/@paulcalvano
17
Common Mistakes
https://httparchive.org
https://almanac.httparchive.org/
<img src="example.jpg" loading="lazy" />
https://web.dev/lazy-loading-images/
https://web.dev/lcp-lazy-loading/
Source: HTTP Archive, October 2024 - Mobile
731K
Sites Failed the Lazy
Loaded LCP
lighthouse audit
~4%
Regardless of
popularity
1. Lazy Loading LCP Images
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
1. Lazy Loading LCP Images
https://x.com/csswizardry/status/1714697877245632832
189K
Sites are doing this!
fetchpriority="high"
loading="lazy"
decoding="async"
1. Lazy Loading LCP Images
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
__________________________________
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
______________________________________________________
Correction - this isn’t a mistake after all. Thanks Barry Pollard!
https://www.tunetheweb.com/blog/what-does-the-image-decoding-attribute-actually-do/
<link rel="preconnect"
href="https://example.com" crossorigin />
Use Preconnect for a domain
used on the same page.
Otherwise use Dns-Prefetch
Document Request
Preconnect from
Response Header
Default
DNS Prefetch
Preconnect from
Response Body
DNS
TCP
TLS
HTTP
Preconnect via
Early Hints
If the domain is needed
early in the page, the
Preconnect should occur
earlier.
<link rel="preconnect" href="//i.etsystatic.com" />
This looks like a dns-prefetch!
https://w3c.github.io/resource-hints/
Source: HTTP Archive, October 2024
9.2 Million
Preconnects in HTML
4.6 Million
Missing crossorigin
Many are blocked by CORS
1. Lazy Loading LCP Images
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
4. Preconnect with missing crossorigin
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
__________________________________
4. Preconnect with missing crossorigin
<link rel="preload"
href="/fonts/opensans.woff2"
as="font" />
Preload from
Early Hint
Document Request
Default
Preload from
Response Body
Preload from
Response Header
DNS
TCP
TLS
HTTP
Preload if you need the
request to load early on the
current page.
Avoid preloading too much.
Preloading will delay other
high priority resources.
2.4 Million
Sites using Preload
Source: HTTP Archive, October 2024
34,553
Preload > 20
requests
48,203
Preload > 1MB of
content
1,163
Preload Video
137,997
Preload Multiple
Images
Source: HTTP Archive, October 2024
1. Lazy Loading LCP Images
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
4. Preconnect with missing crossorigin
5. Preloading multiple images
6. Preloading excessive requests and bytes
7. Preloading videos
8.
9.
10.
11.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
__________________________________
5. Preloading multiple images
6. Preloading excessive requests and bytes
7. Preloading videos
379
Unused Preloads
279
Unused Preloads
1.2 Million
Sites’ with Unused Preloads
(that’s almost 50% of sites using preload)
Source: HTTP Archive, October 2024
1. Lazy Loading LCP Images
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
4. Preconnect with missing crossorigin
5. Preloading multiple images
6. Preloading excessive requests and bytes
7. Preloading videos
8. Unused Preloads
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
__________________________________
8. Unused Preloads
<link rel="preload"
href="/fonts/opensans.woff2" />
37,185
Sites Missing Preload Type
Source: HTTP Archive, October 2024
1. Lazy Loading LCP Images
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
4. Preconnect with missing crossorigin
5. Preloading multiple images
6. Preloading excessive requests and bytes
7. Preloading videos
8. Unused Preloads
9. Preload with missing “as” attribute
10. Preloading versions of the same font
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
__________________________________
9. Preload with missing “as” attribute
10. Preloading versions of the same font
https://almanac.httparchive.org/en/2024/fonts
font-display=swap
and
Preload fonts
495K Sites use
1. Lazy Loading LCP Images
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
4. Preconnect with missing crossorigin
5. Preloading multiple images
6. Preloading excessive requests and bytes
7. Preloading videos
8. Unused Preloads
9. Preload with missing “as” attribute
10. Preloading versions of the same font
11. Font-Display: swap for Preloaded fonts
12.
13.
14.
15.
16.
17.
18.
19.
20.
__________________________________
11. Font-Display:swap for Preloaded Fonts
Content-Encoding: [gzip|br|zstd]
● In 2024, every web server, web browser and CDN supports at least Gzip compression.
● Most also support Brotli compression
US Geological Survey - 2024-04-05 Earthquake Aftershocks
https://x.com/paulcalvano/status/1776302447108972663
https://tools.paulcalvano.com/compression-tester/
1. Lazy Loading LCP Images
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
4. Preconnect with missing crossorigin
5. Preloading multiple images
6. Preloading excessive requests and bytes
7. Preloading videos
8. Unused Preloads
9. Preload with missing “as” attribute
10. Preloading versions of the same font
11. Font-Display: swap for Preloaded fonts
12. No Gzip of Brotli compression
13.
14.
15.
16.
17.
18.
19.
20.
__________________________________
12. No Gzip or Brotli compression
https://paulcalvano.com/2024-03-19-choosing-between-gzip-brotli-and-zstandard-compression/
NGINX’s default gzip compression level is 1
If you use NGINX, check your compression levels.
If you make a change to your compression levels, you will also need to purge CDN
caches, because they cache the compressed content you served.
1. Lazy Loading LCP Images
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
4. Preconnect with missing crossorigin
5. Preloading multiple images
6. Preloading excessive requests and bytes
7. Preloading videos
8. Unused Preloads
9. Preload with missing “as” attribute
10. Preloading versions of the same font
11. Font-Display: swap for Preloaded fonts
12. No Gzip of Brotli compression
13. Inadequate compression levels
14.
15.
16.
17.
18.
19.
20.
__________________________________
13. Inadequate compression levels
https://paulcalvano.com/2024-09-03-discovering-third-party-performance-risks/
4610
Third Party domains
serving uncompressed
content
Source: HTTP Archive, October 2024
1. Lazy Loading LCP Images
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
4. Preconnect with missing crossorigin
5. Preloading multiple images
6. Preloading excessive requests and bytes
7. Preloading videos
8. Unused Preloads
9. Preload with missing “as” attribute
10. Preloading versions of the same font
11. Font-Display: swap for Preloaded fonts
12. No Gzip of Brotli compression
13. Inadequate compression levels
14. Third Parties not compressing assets
15.
16.
17.
18.
19.
20.
__________________________________
14. Third Parties not compressing assets
https://www.speedcurve.com/blog/performance-budgets/
1. Lazy Loading LCP Images
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
4. Preconnect with missing crossorigin
5. Preloading multiple images
6. Preloading excessive requests and bytes
7. Preloading videos
8. Unused Preloads
9. Preload with missing “as” attribute
10. Preloading versions of the same font
11. Font-Display: swap for Preloaded fonts
12. No Gzip of Brotli compression
13. Inadequate compression levels
14. Third Parties not compressing assets
15. Bypassing image optimizations
16.
17.
18.
19.
20.
__________________________________
15. Bypassing automated image optimizations
200K
Sites load more than
1MB from S3
580K
Sites load images from
S3 instead of a CDN
Source: HTTP Archive, October 2024
1. Lazy Loading LCP Images
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
4. Preconnect with missing crossorigin
5. Preloading multiple images
6. Preloading excessive requests and bytes
7. Preloading videos
8. Unused Preloads
9. Preload with missing “as” attribute
10. Preloading versions of the same font
11. Font-Display: swap for Preloaded fonts
12. No Gzip of Brotli compression
13. Inadequate compression levels
14. Third Parties not compressing assets
15. Bypassing image optimizations
16. Using S3 for Image Delivery
17.
18.
19.
20.
16. Using S3 for Image Delivery
913K
Sites are gzip
compressing
first party
images
1. Lazy Loading LCP Images
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
4. Preconnect with missing crossorigin
5. Preloading multiple images
6. Preloading excessive requests and bytes
7. Preloading videos
8. Unused Preloads
9. Preload with missing “as” attribute
10. Preloading versions of the same font
11. Font-Display: swap for Preloaded fonts
12. No Gzip of Brotli compression
13. Inadequate compression levels
14. Third Parties not compressing assets
15. Bypassing image optimizations
16. Using S3 for Image Delivery
17. Gzip compressing images
18.
19.
20.
__________________________________
17. Gzip compressing images
Hypothesis
Testing
Validation
Monitoring
This feature will improve [metric].
WebPageTest
Browser Dev Tools
RUM
A/B Testing
RUM
Synthetic Measurements
Performance Budgets
1. Lazy Loading LCP Images
2. Lazy Loading High Priority Images
3. Async Decoding for High Priority Images
4. Preconnect with missing crossorigin
5. Preloading multiple images
6. Preloading excessive requests and bytes
7. Preloading videos
8. Unused Preloads
9. Preload with missing “as” attribute
10. Preloading versions of the same font
11. Font-Display: swap for Preloaded fonts
12. No Gzip or Brotli compression
13. Inadequate compression levels
14. Third Parties not compressing assets
15. Bypassing image optimizations
16. Using S3 for Image Delivery
17. Gzip compressing images
Performance Mistakes
__________________________________
How the HTTP Archive Works
● httparchive.org
● Monthly trends
● Discussion forum
● Web Almanac
Chrome UX Report
~16-18 million URLs
https://har.fyi/guides/getting-started/
Thank You!
Performance Architect @Etsy
Paul Calvano
https://webperf.social/@paulcalvano
https://www.linkedin.com/in/paulcalvano/

Performance Now '24- Performance Mistakes - Final.pdf

  • 1.
    Performance Mistakes …an HTTPArchive Deep Dive Performance Architect @ Etsy Paul Calvano https://bsky.app/profile/paulcalvano.bsky.social https://www.linkedin.com/in/paulcalvano/ https://webperf.social/@paulcalvano
  • 2.
  • 6.
  • 7.
  • 8.
    <img src="example.jpg" loading="lazy"/> https://web.dev/lazy-loading-images/
  • 11.
  • 12.
    Source: HTTP Archive,October 2024 - Mobile 731K Sites Failed the Lazy Loaded LCP lighthouse audit ~4% Regardless of popularity
  • 13.
    1. Lazy LoadingLCP Images 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 1. Lazy Loading LCP Images
  • 14.
  • 15.
  • 16.
    1. Lazy LoadingLCP Images 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. __________________________________ 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images ______________________________________________________ Correction - this isn’t a mistake after all. Thanks Barry Pollard! https://www.tunetheweb.com/blog/what-does-the-image-decoding-attribute-actually-do/
  • 19.
  • 20.
    Use Preconnect fora domain used on the same page. Otherwise use Dns-Prefetch Document Request Preconnect from Response Header Default DNS Prefetch Preconnect from Response Body DNS TCP TLS HTTP Preconnect via Early Hints If the domain is needed early in the page, the Preconnect should occur earlier.
  • 21.
    <link rel="preconnect" href="//i.etsystatic.com"/> This looks like a dns-prefetch!
  • 22.
  • 23.
    Source: HTTP Archive,October 2024 9.2 Million Preconnects in HTML 4.6 Million Missing crossorigin Many are blocked by CORS
  • 24.
    1. Lazy LoadingLCP Images 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images 4. Preconnect with missing crossorigin 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. __________________________________ 4. Preconnect with missing crossorigin
  • 25.
  • 26.
    Preload from Early Hint DocumentRequest Default Preload from Response Body Preload from Response Header DNS TCP TLS HTTP Preload if you need the request to load early on the current page. Avoid preloading too much. Preloading will delay other high priority resources.
  • 27.
    2.4 Million Sites usingPreload Source: HTTP Archive, October 2024
  • 28.
    34,553 Preload > 20 requests 48,203 Preload> 1MB of content 1,163 Preload Video 137,997 Preload Multiple Images Source: HTTP Archive, October 2024
  • 29.
    1. Lazy LoadingLCP Images 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images 4. Preconnect with missing crossorigin 5. Preloading multiple images 6. Preloading excessive requests and bytes 7. Preloading videos 8. 9. 10. 11. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. __________________________________ 5. Preloading multiple images 6. Preloading excessive requests and bytes 7. Preloading videos
  • 31.
  • 32.
  • 33.
    1.2 Million Sites’ withUnused Preloads (that’s almost 50% of sites using preload) Source: HTTP Archive, October 2024
  • 34.
    1. Lazy LoadingLCP Images 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images 4. Preconnect with missing crossorigin 5. Preloading multiple images 6. Preloading excessive requests and bytes 7. Preloading videos 8. Unused Preloads 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. __________________________________ 8. Unused Preloads
  • 35.
  • 36.
    37,185 Sites Missing PreloadType Source: HTTP Archive, October 2024
  • 37.
    1. Lazy LoadingLCP Images 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images 4. Preconnect with missing crossorigin 5. Preloading multiple images 6. Preloading excessive requests and bytes 7. Preloading videos 8. Unused Preloads 9. Preload with missing “as” attribute 10. Preloading versions of the same font 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. __________________________________ 9. Preload with missing “as” attribute 10. Preloading versions of the same font
  • 38.
  • 39.
    1. Lazy LoadingLCP Images 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images 4. Preconnect with missing crossorigin 5. Preloading multiple images 6. Preloading excessive requests and bytes 7. Preloading videos 8. Unused Preloads 9. Preload with missing “as” attribute 10. Preloading versions of the same font 11. Font-Display: swap for Preloaded fonts 12. 13. 14. 15. 16. 17. 18. 19. 20. __________________________________ 11. Font-Display:swap for Preloaded Fonts
  • 41.
  • 42.
    ● In 2024,every web server, web browser and CDN supports at least Gzip compression. ● Most also support Brotli compression
  • 43.
    US Geological Survey- 2024-04-05 Earthquake Aftershocks
  • 44.
  • 45.
  • 46.
    1. Lazy LoadingLCP Images 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images 4. Preconnect with missing crossorigin 5. Preloading multiple images 6. Preloading excessive requests and bytes 7. Preloading videos 8. Unused Preloads 9. Preload with missing “as” attribute 10. Preloading versions of the same font 11. Font-Display: swap for Preloaded fonts 12. No Gzip of Brotli compression 13. 14. 15. 16. 17. 18. 19. 20. __________________________________ 12. No Gzip or Brotli compression
  • 47.
  • 48.
    NGINX’s default gzipcompression level is 1 If you use NGINX, check your compression levels. If you make a change to your compression levels, you will also need to purge CDN caches, because they cache the compressed content you served.
  • 49.
    1. Lazy LoadingLCP Images 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images 4. Preconnect with missing crossorigin 5. Preloading multiple images 6. Preloading excessive requests and bytes 7. Preloading videos 8. Unused Preloads 9. Preload with missing “as” attribute 10. Preloading versions of the same font 11. Font-Display: swap for Preloaded fonts 12. No Gzip of Brotli compression 13. Inadequate compression levels 14. 15. 16. 17. 18. 19. 20. __________________________________ 13. Inadequate compression levels
  • 50.
  • 51.
    4610 Third Party domains servinguncompressed content Source: HTTP Archive, October 2024
  • 52.
    1. Lazy LoadingLCP Images 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images 4. Preconnect with missing crossorigin 5. Preloading multiple images 6. Preloading excessive requests and bytes 7. Preloading videos 8. Unused Preloads 9. Preload with missing “as” attribute 10. Preloading versions of the same font 11. Font-Display: swap for Preloaded fonts 12. No Gzip of Brotli compression 13. Inadequate compression levels 14. Third Parties not compressing assets 15. 16. 17. 18. 19. 20. __________________________________ 14. Third Parties not compressing assets
  • 54.
  • 55.
    1. Lazy LoadingLCP Images 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images 4. Preconnect with missing crossorigin 5. Preloading multiple images 6. Preloading excessive requests and bytes 7. Preloading videos 8. Unused Preloads 9. Preload with missing “as” attribute 10. Preloading versions of the same font 11. Font-Display: swap for Preloaded fonts 12. No Gzip of Brotli compression 13. Inadequate compression levels 14. Third Parties not compressing assets 15. Bypassing image optimizations 16. 17. 18. 19. 20. __________________________________ 15. Bypassing automated image optimizations
  • 56.
    200K Sites load morethan 1MB from S3 580K Sites load images from S3 instead of a CDN Source: HTTP Archive, October 2024
  • 57.
    1. Lazy LoadingLCP Images 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images 4. Preconnect with missing crossorigin 5. Preloading multiple images 6. Preloading excessive requests and bytes 7. Preloading videos 8. Unused Preloads 9. Preload with missing “as” attribute 10. Preloading versions of the same font 11. Font-Display: swap for Preloaded fonts 12. No Gzip of Brotli compression 13. Inadequate compression levels 14. Third Parties not compressing assets 15. Bypassing image optimizations 16. Using S3 for Image Delivery 17. 18. 19. 20. 16. Using S3 for Image Delivery
  • 58.
  • 59.
    1. Lazy LoadingLCP Images 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images 4. Preconnect with missing crossorigin 5. Preloading multiple images 6. Preloading excessive requests and bytes 7. Preloading videos 8. Unused Preloads 9. Preload with missing “as” attribute 10. Preloading versions of the same font 11. Font-Display: swap for Preloaded fonts 12. No Gzip of Brotli compression 13. Inadequate compression levels 14. Third Parties not compressing assets 15. Bypassing image optimizations 16. Using S3 for Image Delivery 17. Gzip compressing images 18. 19. 20. __________________________________ 17. Gzip compressing images
  • 60.
    Hypothesis Testing Validation Monitoring This feature willimprove [metric]. WebPageTest Browser Dev Tools RUM A/B Testing RUM Synthetic Measurements Performance Budgets
  • 61.
    1. Lazy LoadingLCP Images 2. Lazy Loading High Priority Images 3. Async Decoding for High Priority Images 4. Preconnect with missing crossorigin 5. Preloading multiple images 6. Preloading excessive requests and bytes 7. Preloading videos 8. Unused Preloads 9. Preload with missing “as” attribute 10. Preloading versions of the same font 11. Font-Display: swap for Preloaded fonts 12. No Gzip or Brotli compression 13. Inadequate compression levels 14. Third Parties not compressing assets 15. Bypassing image optimizations 16. Using S3 for Image Delivery 17. Gzip compressing images Performance Mistakes __________________________________
  • 62.
    How the HTTPArchive Works ● httparchive.org ● Monthly trends ● Discussion forum ● Web Almanac Chrome UX Report ~16-18 million URLs
  • 63.
  • 64.
    Thank You! Performance Architect@Etsy Paul Calvano https://webperf.social/@paulcalvano https://www.linkedin.com/in/paulcalvano/