Appendix B. Measuring HTTP Traffic

 

In chapters 3 and 4, we developed several different prototypes of the Ajax-powered QuickGallery application. As part of the decision-making process for picking the one that we would carry forward for development into version 2, we measured the HTTP traffic generated by each, and presented some graphs.

Being able to measure and present data on web traffic with an application can be extremely useful. We used it to evaluate alternative designs for an app. It can also be used when planning a new release of a program to measure the load that different versions of an application place on the network.

In this chapter, we’re going to share our HTTP measuring toolkit with you, and show you how to generate graphs of the types we showed in chapter 4. We’ve relegated this to an appendix because it isn’t directly concerned with Prototype and Scriptaculous, but we hope you’ll find it useful.

There are three phases to the process. First, we need to capture the raw data. Second, we need to parse it, and generate summary reports. Third, we need to present the data. We’ll begin by looking at the raw data capture.

B.1. Capturing HTTP traffic data

In the simplest of situations, HTTP traffic passes directly between your web browser and the web server (figure B.1). It is sometimes the case that your requests are routed through one or more proxy servers that may filter or block sites, or cache responses locally to reduce network load (figure B.2).

B.2. Parsing HTTP traffic data