CS193H: High Performance Web Sites Lecture 10: Rule 6 – Put Scripts at the Bottom Steve Souders Google

Slides:



Advertisements
Similar presentations
Web 2.0 Programming 1 © Tongji University, Computer Science and Technology. Web Web Programming Technology 2012.
Advertisements

Building Fast 3rd-Party Webapps O'Reilly Velocity Web Performance and Operations Conference 24 June Lessons.
CS193H: High Performance Web Sites Lecture 9: Rule 5 – Put Stylesheets at the Top Steve Souders Google
CS193H: High Performance Web Sites Lecture 16: Rule 13 – Configure ETags Steve Souders Google
CS193H: High Performance Web Sites Lecture 4: Class Projects Steve Souders Google
CS193H: High Performance Web Sites Lecture 22: Vol 2 – Optimize Images, Use Iframes Sparingly, Flush the Document Early Steve Souders Google
CS193H: High Performance Web Sites Lecture 1: Introduction Steve Souders Google
CS193H: High Performance Web Sites Lecture 17: Rule 14 – Make Ajax Cacheable Steve Souders Google
CS193H: High Performance Web Sites Lecture 8: Rule 4 – Gzip Components
CS193H: High Performance Web Sites Lecture 21: Vol 2 – Split Dominant Domains Steve Souders Google
High Performance Web Sites Essential Knowledge for Frontend Engineers
CS193H: High Performance Web Sites Lecture 15: Rule 12 – Remove Duplicate Scripts Steve Souders Google
CS193H: High Performance Web Sites Lecture 3: HTTP and the Web 100 Performance Profile Steve Souders Google
CS193H: High Performance Web Sites Lecture 6: Use a CDN Steve Souders Google
CS193H: High Performance Web Sites Lecture 20: Vol 2 – Don't Scatter Inline Scripts Steve Souders Google
Steve Souders Even Faster Web Sites best practices for faster pages Disclaimer: This content does not necessarily.
CS193H: High Performance Web Sites Lecture 5: Make Fewer HTTP Requests Steve Souders Google
CS193H: High Performance Web Sites Lecture 12: Rule 8 – Make JavaScript and CSS External Steve Souders Google
CS193H: High Performance Web Sites Lecture 19: Vol 2 – Load Scripts Without Blocking Steve Souders Google
CS193H: High Performance Web Sites Lecture 2: The Importance of Frontend Performance Steve Souders Google
CS193H: High Performance Web Sites Lecture 11: Rule 7 – Avoid CSS Expressions Rule 9 – Reduce DNS Lookups Steve Souders Google
CS193H: High Performance Web Sites Lecture 18: Vol 2 – Split the Initial Payload Steve Souders Google
Web Performance Meetup 1 Web Performance 101 Jeremy
Web Performance Meetup 1 Web Performance Toolbelt Jeremy
1 IEEE Symposium on Security and Privacy, May 2009 Shuo Chen, Ziqing Mao, Yi-Min Wang, Ming Zhang Microsoft Research Purdue University May 20 th, 2009.
The World Wide Web and the Internet MIS XLM.B Jack G. Zheng May 13 th 2008.
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
CS193H: High Performance Web Sites Lecture 24: Vol 2 – CSS Descendant Selectors, Forced Compression Steve Souders Google
CS 22: Enhanced Web Site Design - Week 8Slide 1 of 15 Enhanced Web Site Design Stanford University Continuing Studies CS 22 Mark Branom
Fawaz Ghali AJAX: Web Programming's Toy.
Getting Familiar with Web Pages 1 2 The Internet Worldwide collection of interconnected computer networks that enables businesses, organizations, governments,
Create a website with Google Sites
CHAPTER 15 WEBPAGE OPTIMIZATION. LEARNING OBJECTIVES How to test your web-page performance How browser and server interactions impact performance What.
HTTP Request/Response Process 1.Enter URL ( in your browser’s address bar. 2.Your browser uses DNS to look up IP address of server.com.
Copyright © 2012 Certification Partners, LLC -- All Rights Reserved Lesson 4: Web Browsing.
Lesson 4: Web Browsing.
Performance Comparison of Congested HTTP/2 Links Brian Card, CS /7/
High Performance Websites (Based on Steve Souder’s lecture) By Bhoomi Patel.
Mark Phillip markphillip.com 200s, 304s, Expires Headers, HTTP Compression, And You.
WEB DESIGN SOME FOUNDATIONS. SO WHAT IS THIS INTERNET.
Getting Started with Dreamweaver
Computer Concepts 2014 Chapter 7 The Web and .
Adobe Dreamweaver CS5 Introduction Web Site Development and Adobe Dreamweaver CS5.
1 Session 1: Introduction to HTML Spring Today’s Agenda Cover useful terminology for today’s session HTML, browsers, servers, etc. HTML Tags Get.
INTERNET. BROADBAND The amount of information a connection is capable of carrying. Measured in bits per second.
DHTML - Introduction Chapter Introduction to DHTML, the DOM, JS review.
CS 241 Section (04/19/12). MP8  Web Server  Due: Tuesday, May 1 st, 11:59pm  What will you be doing?  Creating a web-server in C that serves HTML.
Grid Chemistry System Architecture Overview Akylbek Zhumabayev.
Don't Let Third Parties Slow You Down Arvind Jain, Michael Kleber Google.
Web Design (1) Terminology. Coding ‘languages’ (1) HTML - Hypertext Markup Language - describes the content of a web page CSS - Cascading Style Sheets.
Browser Bugs & Validation SIPB Introduction to Web Design Wednesday, January 20th Jonté Craighead & Cathy Zhang.
Chapter 1 Getting Started With Dreamweaver. Exploring the Dreamweaver Workspace The Dreamweaver workspace is where you can find all the tools to create.
Safe browsing - is an ad-blocker extension enough? AIMILIOS TSOUVELEKAKIS IT-DI-CSO IT LIGHTNING TALK – 12/
Web Technologies Lecture 7 Synchronous vs. asynchronous.
PART 2 INTRODUCTION TO DYNAMIC WEB CONTENT AND PHP.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Web Cache. What is Cache? Cache is the storing of data temporarily to improve performance. Cache exist in a variety of areas such as your CPU, Hard Disk.
+ CIW LESSON 4 Web Browsers. + Basic Functions of Web Browsers Provide a way for users to access and navigate Web pages Display Web pages properly Provide.
Web Page Design The Basics. The Web Page A document (file) created using the HTML scripting language. A document (file) created using the HTML scripting.
Getting Started with Dreamweaver
CISC103 Web Development Basics: Web site:
Lesson 4: Web Browsing.
Chapter 4: HTML5 Media - <video> & <audio>
Tips for Website Speed Optimization
Browser Support for HTML5
Getting Started with Dreamweaver
Lesson 4: Web Browsing.
Research Lesson 1 URLs & Hyperlinks How to access the World Wide Web.
Research Lesson 1 URLs & Hyperlinks How to access the World Wide Web.
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

CS193H: High Performance Web Sites Lecture 10: Rule 6 – Put Scripts at the Bottom Steve Souders Google

Announcements alternate final exam slot Tues, Dec 9, 12:15-3:15 exam will also be given during default time slot: Dec 12, 12:15-3:15 locations TBD

Parallel downloads HTTP spec recommends only two connections (parallel downloads) per hostname results in a stairstep pattern general rule: page load time increases for every two resources added

More connections newer browsers open more connections per hostname Chrome 6 Firefox 2 2 Firefox 3 6 IE 6,7 2 IE 8 6 Opera 8 Safari 4 domain sharding – split resources across multiple domains to increase parallelization previous example using two domains browser looks at name, not IP address

parallelization is an opportunity for improving load times

Scripts block unfortunately, scripts block in two ways downloading resources below the script rendering elements below the script moving the scripts lower means less blocking

Challenges document.write scripts that perform document.write must be placed where the content is to be inserted alternative: set element.innerHTML ads ads typically are at the top of the page and include scripts alternative: use iframes or lazy-load ads code dependencies some JavaScript must occur higher in the page, and it depends on other scripts alternative: move scripts as low as possible, combine them

Script defer IE only currently; just added to Firefox 3.1 defers scripts a little bit, but non-deterministic so may still block downloads and rendering if you can defer a script, better to move it to the bottom

Opera delayed scripts opera:config#Extensions|DelayedScriptExecution delays (defers) script loading with some nice enhancements deferred to the very end remembers script location so document.write still works huge improvement for ads prototype for future implementation of defer

Parallel script loading execute scripts in order, but download them in parallel with other resources available in IE8 and Safari 4 coming in Firefox 3.1 and Chrome IE6&7 will be around for years, we have to keep them in mind, so… put scripts at the bottom

HTTP/1.0 vs. HTTP/1.1 back to parallel downloads 2 per hostname... older browsers open more connections for HTTP/1.0 vs. HTTP/1.1 IE 6,7: 4 vs. 2 Firefox 2: 8 vs. 2 since HTTP/1.1 supports persistent connections, this was an attempt to reduce load on servers downgrading to HTTP/1.0 might be faster for older (hugely popular) browsers: aol.com

Homework "Improving Top Site" class project: improvements for Rules 1-3 due today 11:59pm Rule 4 – waiting for Stanford IT to turn on gzip, so not required for this deliverable read Chapter 7 of HPWS

Questions How many connections per hostname is suggested in the HTTP spec? Do all browsers follow this recommendation? What's domain sharding? In what way do scripts block a web page? Give a situation where you can't just move a script to the bottom of the page. Which browsers support parallel script loading? How does HTTP/1.0 vs. HTTP/1.1 affect parallel downloads?