CS193H: High Performance Web Sites Lecture 11: Rule 7 – Avoid CSS Expressions Rule 9 – Reduce DNS Lookups Steve Souders Google

Slides:



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

CS193H: High Performance Web Sites Lecture 9: Rule 5 – Put Stylesheets at the Top Steve Souders Google
CS193H: High Performance Web Sites Lecture 7: Add an Expires Header Steve Souders Google
High Performance Web Sites Essential Knowledge for Frontend Engineers
Episodes a shared approach for timing web pages Steve Souders Google Disclaimer: This content does not necessarily reflect.
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 13: Rule 10 – Minify JavaScript Steve Souders Google
CS193H: High Performance Web Sites Lecture 22: Vol 2 – Optimize Images, Use Iframes Sparingly, Flush the Document Early Steve Souders Google
Steve Souders Even Faster Web Sites best practices for faster pages Disclaimer:
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
Steve Souders Even Faster Web Sites best practices for faster pages Disclaimer: This content does not necessarily.
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 10: Rule 6 – Put Scripts at the Bottom Steve Souders Google
CS193H: High Performance Web Sites Lecture 2: The Importance of Frontend Performance 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
Credit hours: 4 Contact hours: 50 (30 Theory, 20 Lab) Prerequisite: TB143 Introduction to Personal Computers.
September Public Library Web Managers Workshop 2000 Cascading Style Sheets Manjula Patel UKOLN University of Bath Bath, BA2 7AY UKOLN is funded.
Slice and Dice: From PSD Image to XHTML+CSS Svetlin Nakov Telerik Corporation
Web Site Performance What makes web sites slow? Back end Front end Tools for measuring performance Firebug / YSlow Visual Studio Test Edition W3.org html.
ECA 228 Internet/Intranet Design I
Essentials for Design JavaScript Level One Michael Brooks
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 22, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
Week 10 Creating Positioned Layouts
15 LAYOUT Controlling the position of elements Creating site layouts Designing for different sized screens.
Bring Life to Your Web Pages with JavaScript and HTML5 Ole Ildsgaard Hougaard -
CHAPTER 15 WEBPAGE OPTIMIZATION. LEARNING OBJECTIVES How to test your web-page performance How browser and server interactions impact performance What.
Quiz #3 - CSS Lecture Code: Get Neighbors’ URLs for MP1
JavaScript and the DOM Les Carr COMP3001 Les Carr COMP3001.
An Introduction to the Internet and the Web Frank McCown COMP 250 – Internet Development Harding University.
How’s My Network (HMN)? A Java approach to Home Network Measurement Alan Ritacco, Craig Wills, and Mark Claypool Computer Science Department Worcester.
HTML and Web Page Design Presented by Frank H. Osborne, Ph. D. © 2005 ID 2950 Technology and the Young Child.
High Performance Websites (Based on Steve Souder’s lecture) By Bhoomi Patel.
Application Layer. Domain Name System Domain Name System (DNS) Problem – Want to go to but don’t know the IP addresswww.google.com Solution.
Mark Phillip markphillip.com 200s, 304s, Expires Headers, HTTP Compression, And You.
IMAGES Controlling size of images in CSS Aligning images in CSS Adding background images.
NET0183 Networks and Communications Lecture 25 DNS Domain Name System 8/25/20091 NET0183 Networks and Communications by Dr Andy Brooks.
DHTML - Introduction Introduction to DHTML, the DOM, JS review.
Chapter 16 – DNS. DNS Domain Name Service This service allows client machines to resolve computer names (domain names) to IP addresses DNS works at the.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
CS 215 Web Oriented Programming Review Dr. Orland Hoeber orland
Integrating JavaScript and HTML5 HTML5 & CSS 7 th Edition.
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network Chapter 6: Name Resolution.
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network, Enhanced Chapter 6: Name Resolution.
October 8, 2015 University of Tulsa - Center for Information Security Microsoft Windows 2000 DNS October 8, 2015.
World Wide Web Aaditya Bhatia CS 147. Agenda History OSI model Hardware IP address DNS Server - Client Peer-to-peer Web-Sites Web programming Search engines.
DHTML - Introduction Chapter Introduction to DHTML, the DOM, JS review.
Page Speed Bryan McQuade Richard Rabbat. Outline  What is Page Speed?  Inception of Page Speed  Cool features  Identify unused JavaScript and CSS.
Session I Chapter 1 - Introduction to Web Development
Department of Computer Science Internet Performance Measurements using Firefox Extensions Scot L. DeDeo Professor Craig Wills.
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
Layout with Styles Castro Chapter 11. Tables vs. CSS You can produce “liquid layouts” (layouts that stretch as the browser is resized) using tables or.
Browser Compatibility Testing, using different browsers Conditional Statements.
Cascading Style Sheets Layout
Chapter 12: Automated data collection methods
Introduction to DHTML, the DOM, JS review
Windows Name Resolution
Presentation transcript:

CS193H: High Performance Web Sites Lecture 11: Rule 7 – Avoid CSS Expressions Rule 9 – Reduce DNS Lookups Steve Souders Google

Announcements Aravind and I are grading Rules 1-3 of "Improving a Top Site" class project now people who turned in after 11:59pm Mon get 10 points off

CSS expressions used to set CSS properties dynamically in IE 5-7 fixes IE CSS 2.1 bugs and shortcomings, such as lack of support for min-width min-width: 600px; width: expression( document.body.clientWidth < 600 ? 600px : auto ); problem: expressions execute 1000s of times mouse move, key press, resize, scroll, etc. counter.php (IE only!) expression's JavaScript can slow down pages

Alternatives to expressions expressions are evaluated all the time (mouse move, etc.), this is what makes them easy but slow alternatives are more work but reduce the amount of JavaScript code executed alternatives: one-time expressions event handlers

One-Time Expressions if an expression only needs to be calculated once, it can overwrite itself with the value #maindiv { min-width: 600px; width: expression(setW(this));} function setW(elem) { elem.style.runtimeStyle.width = ( document.body.clientWidth < 600 ? "600px" : "auto" ); } doesn't handle window resizing overwrite the expression

Event Handlers tie the code to the specific event(s) of interest #maindiv { min-width: 600px; width: expression(setW(this));} function setW() { elem=document.getElementById('maindiv'); elem.style.runtimeStyle.width = ( document.body.clientWidth < 600 ? "600px" : "auto" ); } window.onresize = setW;

Expressions in IE8 expressions are no longer supported in IE8 standards mode reasons: standards compliance – issues fixed in IE8 performance security – "reduce browser attack surface" expressions.aspx but we'll still need to deal with IE6&7 for years to come

DNS Lookups typically take ms, sometimes > 500ms OS and browsers cache DNS resolutions

Viewing DNS in Windows C:\>ipconfig /flushdns Windows IP Configuration Successfully flushed the DNS Resolver Cache. C:\>ipconfig /displaydns Windows IP Configuration Record Name..... : Record Type..... : 5 Time To Live.... : 43 Data Length..... : 4 Section : Answer CNAME Record.... :

TTL < 30 minutes might not impact users TTL (Time to Live) minute minute minutes hour minutes minutes hour hour minute minutes March 2007

Browser DNS Cache IE 7 DnsCacheTimeout: 30 minutes KeepAliveTimeout: 1 minute ServerInfoTimeout: 2 minutes Firefox 2 network.dnsCacheExpiration: 1 minute network.dnsCacheEntries: 20 network.http.keep-alive.timeout: 5 minutes Fasterfox: 1 hour, 512 entries, 30 seconds

Reducing DNS Lookups use Keep-Alive adding DNS lookups vs. domain sharding identify dominant domain names, reduce non- dominant names for dominant domains – shard across 2-4 CNAMEs

Homework read Chapter 8 & 9 of HPWS

Questions How do CSS expressions affect performance? What are two workarounds to this problem with CSS expressions? How long does a DNS lookup typically take? What are three places where DNS resolutions are cached? What's a TTL? How do OSes and browsers (not) honor TTLs? What's the guideline for balancing reducing DNS lookups and domain sharding?