Reducing Internet Traffic by Packaging Multiple HTTP Requests

Downloading a web page can produce many HTTP requests. An HTTP request is made for the HTML of the web page itself and a subsequent request is made for each image, audio clip, and other multimedia content referenced in the HTML. This article describes a method of packaging multiple HTTP requests into a single request to reduce Internet traffic. The trade-off is that web servers that service multiple HTTP request packages must package the requested content before delivery to web browsers which must then unpack the content.

1. Introduction

Downloading a web page can produce many HTTP requests. An HTTP request is made for the HTML of the web page itself and a subsequent request is made for each image, audio clip, and other multimedia content referenced in the HTML. Downloading the individual pieces of content has the advantage that the user does not have to wait for the whole page to download before getting feedback that the page is being downloaded; users can watch the page as its parts are progressively downloaded and displayed. Users can also interrupt page downloads, typically by pressing the browser’s Stop button. The disadvantage is that the HTTP request for each piece of content adds to the amount of Internet traffic and the work web servers must perform to service each request.

If a web browser knows that it will make more than one request to the same web server, the amount of Internet traffic can be reduced by making a single HTTP request for all the required content from that web server. This article describes a method of packaging multiple HTTP requests into a single request. Section 2 describes how web browsers package multiple HTTP requests into a single request. Section 3 describes how web servers service such requests.

2. Packaging Multiple Requests

The implementation of multiple HTTP request packages requires a request mechanism for the web browser and a response mechanism for the web server. Multiple HTTP requests are sent to a web server encoded as a URL query. The query parameters specify the relative URL of each piece of content requested from the web site. In the following examples, multiple HTTP requests are serviced by a web server script called multiple:

http://www.website.com/multiple?

Each piece of content is requested using its URL relative to the web site as a value of the page query parameter. For example, to download the multimedia files logo.gif and jingle.wav from the website http://www.website.com/catalogue/, the following query URL would be used:

http://www.website.com/multiple?page=catalogue/logo.gif&page=catalogue/jingle.wav

The base query parameter simplifies multiple requests by specifying a prefix to the value of each page parameter:

http://www.website.com/multiple?base=catalogue&page=logo.gif&page=jingle.wav

After a multiple request URL has been constructed by a web browser it is sent to the web server. In this example, two HTTP requests—one for an image and one for an audio clip—have been packaged into a single HTTP request. Any number of HTTP requests to the same web server can be reduced to a single HTTP request in this way.

3. Serving Multiple Requests

The files that fulfil a multiple HTTP request are returned to the web browser packaged and compressed in a ZIP file. The browser unpacks the ZIP file and processes each file as if it had been downloaded with a separate HTTP request. There is no real performance disadvantage for web browsers that package multiple HTTP requests. Building a multiple request query URL is a trivial task and unpacking files from a ZIP file requires little extra processing.

Although an analysis of web server activity would be required to find out the impact on web servers, it is likely to be small. A simple analysis follows. The current processing effort, p, required to service a sequence of n HTTP requests is composed of the processing required for the request itself, r, plus the processing required for retrieving the content, c, multiplied by n:

p = n(r + c)

The processing, pm, required to service a multiple request package is reduced by r(n - 1) because only one HTTP request is made, and increased by a one time packaging effort, q:

pm = r + nc + q

As long as pm < p, multiple HTTP request packages will reduce the workload of a web server.