Fast ASP.NET Websites
Dean Alan Hume
Copyright
For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact
Special Sales Department Manning Publications Co. 20 Baldwin Road PO Box 261 Shelter Island, NY 11964 Email:
orders@manning.com2013 by Manning Publications Co. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps.
Recognizing the importance of preserving what has been written, it is Mannings policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine.
| Manning Publications Co.20 Baldwin RoadPO Box 261Shelter Island, NY 11964 | Development editor: Jennifer StoutTechnical proofreader: Adam WestCopyeditor: Laura CheuProofreader: Elizabeth MartinTypesetter: Dennis DalinnikCover designer: Marija Tudor |
ISBN: 9781617291258
Printed in the United States of America
1 2 3 4 5 6 7 8 9 10 MAL 19 18 17 16 15 14 13
Dedication
For Emily ngiyakuthanda
Brief Table of Contents
Table of Contents
Preface
Ever since I began building websites, Ive been interested in learning how to make them more efficient. Its a great feeling when you transform a slow website into a finely tuned engine that makes people say Wow! In my pursuit to improve my websites performance, Ive trawled the net and spent long hours trying to find the best techniques. Technology is constantly developing and improving, and developers are finding newer and ever more ingenious ways of speeding up their sites.
If youre a developer who is new to coding and website performance, the plethora of resources can be quite overwhelming. Until I wrote Fast ASP.Net Websites, I hadnt seen a book that teaches the ASP.NET developer the exact formula, in a step-by-step process, how to shave seconds off their page load times and drastically improve the performance of their websites.
I hope you agree this is that book.
Acknowledgments
Until now I never thought about all the research and background work that goes into writing a technical book. This book would definitely not have been possible without the help of many people.
Most importantly, I want to thank my partner Emily for her encouragement and for sticking with me through all the early mornings and weekends it took to finish this book. Every time my alarm went off, you never complained, not even once. Thank you for all your support!
Sincere thanks to Jennifer Stout at Manning Publications for being the best development editor...ever. Your cheerful attitude and brilliant work were instrumental in the evolution of this book. Thank you for always listening to my ideas and being so efficient. Thanks to Michael Stephens for believing in me and in the idea I had for this book. You guided me through each step of the process and this book wouldnt have been possible without your advice! Thanks to Candace Gillhoolley for your help with the marketing of this book and to Rebecca Rinehart for working with me on my idea for the book cover. Many thanks also to everyone on the Manning production team for guiding me through the process and bringing the book to press.
Special thanks to Sam Saffron for helping me review the MiniProfiler content. Sam was one of the creators of MiniProfiler and helped me, even though he and his wife had a new baby on the way, and he was in the process of launching a new website!
I am also grateful to all the reviewers who helped shape and improve the manuscript during its development: Bryn Keller, Danylo Kizyma, Ivo timac, James Berkenbile, Jason Hales, Jeff Smith, Mark Sponsler, Michael Roberts, Onofrio Panzarino, and Wyatt Barnett.
Special thanks to Robin Osborne and Tim Clarke for their reviewing help, and to Adam West for his technical proofread of the final manuscript.
I would like to thank my family for their encouragement throughout the writing process. You have been fantastic!
Finally, thank you for purchasing this book. I hope you enjoy reading it as much as I enjoyed writing it. I hope you will learn valuable techniques you can use and apply to all your websites.
Lets make the web faster!
About this Book
This book is designed to allow you, as a developer, to get the best performance out of your websites. This book delivers details, best practices, caveats, tips, and tricks to improve the performance of your websites and reduce the load times of your web pages.
How to use this book
Every new chapter in this book is intended to teach the reader a new web performance concept. As you follow along with each chapter, and open the accompanying source code, you will be able to follow the steps provided to improve the performance of the sample website. Each chapter in the book is also designed to work as a standalone concept; that is, you can chose a chapter and apply just that technique and you will improve your website. As we progress through the chapters, we will be constantly improving the sample website and each technique will take the sample website closer to performance nirvana.
Who should read this book
This book is for web developers who are looking to improve the performance of their web pages. It is also for developers who are looking to dive a little deeper into web development and understand the page lifecycle that is happening as a user loads their website. This book covers fundamental techniques that are applicable to web pages regardless of the programming language. The techniques that are covered are generally universal, but aimed toward the ASP.NET website developer.
Roadmap
teaches you the valuable skills you need to understand in order to begin improving the performance of your website. It explains the importance of focusing on the front-end code in order to achieve the biggest and most scalable gains.
explains the value and benefits that optimizing your websites will bring. It also shows you the steps youll need to take in order to optimize your websites by using the Performance Cycle.
focuses on the basics of HTTP so you understand the processes that take place under the hood. The chapter then shows you the essential tips and tools youll need in order to interpret performance charts when youre profiling your website. Youll then look at the different profiling tools that youll be using throughout this book.
is where the real work begins. Youll start to investigate and apply individual techniques to improve the performance of your web applications.
covers compression and why you should use it. After going through the different types of compression, youll look at the Surf Store application used throughout this book. Youll then apply compression to the sample application and compare the difference in page sizes.