Code Examples

Online examples can be found on this book's companion web site:

http://stevesouders.com/hpws

Examples are included in each chapter in the context in which they are discussed. They are also listed here for easy review.

No Image Map (Chapter 3)

http://stevesouders.com/hpws/imagemap-no.php

Image Map (Chapter 3)

http://stevesouders.com/hpws/imagemap.php

CSS Sprites (Chapter 3)

http://stevesouders.com/hpws/sprites.php

Inline Images (Chapter 3)

http://stevesouders.com/hpws/inline-images.php

Inline CSS Images (Chapter 3)

http://stevesouders.com/hpws/inline-css-images.php

Separate Scripts (Chapter 3)

http://stevesouders.com/hpws/combo-none.php

Combined Scripts (Chapter 3)

http://stevesouders.com/hpws/combo.php

CDN (Chapter 4)

http://stevesouders.com/hpws/ex-cdn.php

No CDN (Chapter 4)

http://stevesouders.com/hpws/ex-nocdn.php

No Expires (Chapter 5)

http://stevesouders.com/hpws/expiresoff.php

Far Future Expires (Chapter 5)

http://stevesouders.com/hpws/expireson.php

Nothing Gzipped (Chapter 6)

http://stevesouders.com/hpws/nogzip.html

HTML Gzipped (Chapter 6)

http://stevesouders.com/hpws/gzip-html.html

Everything Gzipped (Chapter 6)

http://stevesouders.com/hpws/gzip-all.html

CSS at the Bottom (Chapter 7)

http://stevesouders.com/hpws/css-bottom.php

CSS at the Top (Chapter 7)

http://stevesouders.com/hpws/css-top.php

CSS at the Top Using @import (Chapter 7)

http://stevesouders.com/hpws/css-top-import.php

CSS Flash of Unstyled Content (Chapter 7)

http://stevesouders.com/hpws/css-fouc.php

Scripts in the Middle (Chapter 8)

http://stevesouders.com/hpws/js-middle.php

Scripts Block Downloads (Chapter 8)

http://stevesouders.com/hpws/js-blocking.php

Scripts at the Top (Chapter 8)

http://stevesouders.com/hpws/js-top.php

Scripts at the Bottom (Chapter 8)

http://stevesouders.com/hpws/js-bottom.php

Scripts Top vs. Bottom (Chapter 8)

http://stevesouders.com/hpws/move-scripts.php

Deferred Scripts (Chapter 8)

http://stevesouders.com/hpws/js-defer.php

Expression Counter (Chapter 9)

http://stevesouders.com/hpws/expression-counter.php

One-Time Expressions (Chapter 9)

http://stevesouders.com/hpws/onetime-expressions.php

Event Handler (Chapter 9)

http://stevesouders.com/hpws/event-handler.php

Inlined JS and CSS (Chapter 10)

http://stevesouders.com/hpws/inlined.php

External JS and CSS (Chapter 10)

http://stevesouders.com/hpws/external.php

Cacheable External JS and CSS (Chapter 10)

http://stevesouders.com/hpws/external-cacheable.php

Post-Onload Download (Chapter 10)

http://stevesouders.com/hpws/post-onload.php

Dynamic Inlining (Chapter 10)

http://stevesouders.com/hpws/dynamic-inlining.php

Small Script Normal (Chapter 12)

http://stevesouders.com/hpws/js-small-normal.php

Small Script Minified (Chapter 12)

http://stevesouders.com/hpws/js-small-minify.php

Small Script Obfuscated (Chapter 12)

http://stevesouders.com/hpws/js-small-obfuscate.php

Large Script Normal (Chapter 12)

http://stevesouders.com/hpws/js-large-normal.php

Large Script Minified (Chapter 12)

http://stevesouders.com/hpws/js-large-minify.php

Large Script Obfuscated (Chapter 12)

http://stevesouders.com/hpws/js-large-obfuscate.php

XMLHttpRequest Beacon (Chapter 13)

http://stevesouders.com/hpws/xhr-beacon.php

Image Beacon (Chapter 13)

http://stevesouders.com/hpws/redir-beacon.php

Duplicate Scripts—Not Cached (Chapter 14)

http://stevesouders.com/hpws/dupe-scripts.php

Duplicate Scripts—Cached (Chapter 14)

http://stevesouders.com/hpws/dupe-scripts-cached.php

Duplicate Scripts—10 Cached (Chapter 14)

http://stevesouders.com/hpws/dupe-scripts-cached10.php

In general, you may use the code in this book and these online examples in your programs and documentation. You do not need to contact us for permission unless you're reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O'Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product's documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: "High Performance Web Sites by Steve Souders. Copyright 2007 Steve Souders, 978-0-596-52930-7."

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .

Get High Performance Web Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.