Mark Phillip markphillip
description
Transcript of Mark Phillip markphillip
![Page 1: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/1.jpg)
Mark Phillipmarkphillip.com
200s, 304s,Expires Headers,HTTP Compression,And You
![Page 2: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/2.jpg)
”“Well, I’m including a bunch of
JavaScript and CSS, but usersonly have to download it once.
After that, it’ll be really fast.
![Page 3: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/3.jpg)
Web Browsing 101Your HTML is a shopping list.
![Page 4: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/4.jpg)
Yahoo! Extreme Performance
![Page 5: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/5.jpg)
Make Fewer HTTP Requests
Use a Content Delivery Network
Add an Expires or a Cache-Control Header
Gzip Components
Put Stylesheets at the Top
Put Scripts at the Bottom
Avoid CSS Expressions
Make JavaScript and CSS External
Reduce DNS Lookups
Minify JavaScript and CSS
Avoid Redirects
Remove Duplicate Scripts
Configure ETags
Make Ajax Cacheable
Flush the Buffer Early
Use GET for AJAX Requests
Post-load Components
Preload Components
Reduce the Number of DOM Elements
Split Components Across Domains
Minimize the Number of iframes
No 404s
Reduce Cookie Size
Use Cookie-free Domains for Components
Minimize DOM Access
Develop Smart Event Handlers
Choose <link> over @import
Avoid Filters
Optimize Images
Optimize CSS Sprites
Don't Scale Images in HTML
Make favicon.ico Small and Cacheable
Keep Components under 25K
Pack Components into a Multipart Document
![Page 6: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/6.jpg)
Time-based graph of HTTP traffic as a visitor hits yahoo.com
![Page 7: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/7.jpg)
Servers are Overrated
![Page 8: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/8.jpg)
HTTP ResponseCodes & Headers
![Page 9: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/9.jpg)
HTTP Code: 200Here’s the file you requested. Enjoy.
![Page 10: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/10.jpg)
HTTP Code: 304This file hasn’t changed since the last time youasked about it. Just use the cached version you
have.
![Page 11: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/11.jpg)
First Site Visit: 200s
![Page 12: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/12.jpg)
Second Site Visit: 304s & 200s
![Page 13: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/13.jpg)
DemoLet’s open up Firebug and understand the
bandwidthdifference between the first and second visits.
![Page 14: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/14.jpg)
”“Wait, what else do we
need?
My 25 images and stylesheets weigh in at 100KB. That shouldn’t take more than a couple seconds to download.
After it’s cached, it should be pretty much instant.
![Page 15: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/15.jpg)
DemoJust how long does it take to communicate with a server?Is it fast enough that we can do it 20 times on one page?
![Page 16: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/16.jpg)
Give me a ping, Vasili.One ping only, please.
![Page 17: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/17.jpg)
HTTP Header: ExpiresHere’s the file you requested. Enjoy.
Oh yeah, and don’t ask for this file again until Tuesday.
![Page 18: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/18.jpg)
DemoSo how does the Expires Header change things?
![Page 19: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/19.jpg)
What determines the 304?
![Page 20: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/20.jpg)
When Was My PHP Modified?
![Page 21: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/21.jpg)
How do we make more 304s?PHP: header("Last-Modified: Mon, 26 Jul 2008 05:00:00 GMT")
JSP: response.setHeader("Last-Modified", "Mon, 26 Jul 2008 05:00:00 GMT")
![Page 22: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/22.jpg)
Channel Your Inner Columbo
![Page 23: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/23.jpg)
RUWT? API: Hits
![Page 24: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/24.jpg)
RUWT? API: Bytes
![Page 25: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/25.jpg)
One-Size-Fits-All CodingHTTP Compression is your friend.
![Page 26: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/26.jpg)
Final ParadoxThe number of hits on your site is not
a badge of honor. Reducing the numberof hits will improve the user experience.
![Page 27: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/27.jpg)
Reduce Traffic. Increase Users.
![Page 28: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/28.jpg)
Thanks!
Mark Phillipmarkphillip.com
![Page 29: Mark Phillip markphillip](https://reader036.fdocuments.in/reader036/viewer/2022070404/56813c0a550346895da57600/html5/thumbnails/29.jpg)
Yahoo! Exceptional Performance TeamBlog
http://developer.yahoo.net/blog/archives/performance/
Performance Rules http://developer.yahoo.com/performance/rules.html
Web-based ToolMozilla Web Sniffer http://web-sniffer.net/
Firefox Add-onsFirebug
https://addons.mozilla.org/en-US/firefox/addon/1843
YSlow https://addons.mozilla.org/en-US/firefox/addon/5369
IE Add-onsHttpWatch http://httpwatch.com