50. • Keep HTML as clean as possible
• Clean up your DOM by removing unused
elements
• Order matters
• Don't put third-party features—such as scripts or
web fonts—in your critical path.
DETERMINEYOUR CRP
52. Follow the 14KB rule
Focus on the above the fold content first, and load other assets
afterwards.
• CSS is critical. Remove render-blocking CSS by using the media
attribute (remembering, however, that the file will still be
downloaded)
• The most important styles, especially above the fold styles,
should go inline
DETERMINEYOUR CRP
53. • Unblock the parser by using attributes such as
defer or async for JavaScript tags where possible
• Put scripts at the bottom of the page to avoid
render blocking
DETERMINEYOUR CRP
55. • Minify your page assets such as HTML, CSS and JavaScript
• The biggest optimization results can be achieved for images
• Use image formats such as PNG, GIF, JPEG, SVG or even
encode the image into a base64 format (data URI) for the web
• Avoid custom web fonts, using them only if really necessary
(and consider a web font loader)
• Use Gzip techniques, to reduce the file size sent over the wire
REDUCE BYTES
57. • Concatenate where applicable, to reduce the amount
of HTTP requests but be smart about it
• Don't blindly use JavaScript libraries and frameworks
just because they are convenient
• Use image sprites to reduce HTTP requests
• For small images, consider using the data URI
technique to remove additional HTTP requests
REDUCE HTTP REQUESTS
59. LATENCY
is the time it takes for the content to be requested
by, and sent to your browser
@bbinto | #leanwebsites
60. • Reduce HTTP requests as much as possible
• The highest latency occurs on mobile devices
• Reduce the amount of polling on your page
• Send the most important styles down the wire as
soon as you can (14KB rule)
FIGHT LATENCY
61. • Remove redirects (DNS lookups) where possible
• Use the keep-alive header that keepsTCP connections open
• Use offline storage techniques such as appcache, local
storage,Web SQL database, or IndexedDB
• Use content delivery networks to avoid high latency
• Use HTTP/2 (and “formerly” SPDY) provide efficient use of
network resources and reduced latency
FIGHT LATENCY
68. • Don't make the user pay for your bad performance
• More HTTP requests and DNS lookups will result in higher
latency
• Weigh the advantages and disadvantages of different mobile
strategies. Choose between mdot, RWD, RESS or RESS with
ESI
• RESS with ESI redirect offers an additional advantage over
regular server-side redirects
TAMETHE MOBILE BEAST
69. • Remember, mobile devices are powered by
batteries
• Consider offline storage techniques
• Test your mobile experience on real devices, as
much as possible (including collecting RUM)
TAMETHE MOBILE BEAST
71. AUTOMATEYOUR PERFORMANCE ROUTINES
• Use task runners such as Grunt, Gulp, Maven or
Ant
• Include task runners and performance APIs in your
continuous integration system
74. AVOIDTHEYO-YO EFFECT
• Constant measuring and monitoring of your
website's performance will help you identify
performance bottlenecks and deal with them
• Automation can be incredibly helpful in fighting the
yo-yo effect by triggering appropriate warnings