RE: BP suggestion: use multipart messages to minimize the number of HTTP requests

Francois,
I can generalize the current section "5.5.6 Minimize External Script Files" which does address use of multipart:

+++++
5.5.6 Minimize External Files

5.5.6.1 What it means

This section elaborates on the best practices of BP1 [section ref].

When an application depends upon multiple external files (e.g. scripts, images, stylesheets), it typically must retrieve them separately from the main resource (e.g. web page) itself. This can increase data usage and service latency. Overall reduction of the number and size of external files can avoid these effects. 

5.5.6.2 How to do it

If your application depends upon external files:

- Reduce the number of HTTP GETs required to retrieve the script files, e.g. by 
  - Keep the number of script files to a minimum, e.g. by combining several script files into one 
  - Send the external files and main page together as a multipart/related package

- Reduce the size of your stlesheet and script files, e.g. by 
  - Removing whitespace and comments 
  - Making variable names in the code shorter 
  - Use HTTP 1.1 compression [5.5.1 Support HTTP 1.1 Compression] when sending text files

Note that caching can also diminish the overhead for transfer of external files, however as the files are collected into single packages, the efficiency of caching may diminish. So you should seek an optimum balance between aggregation and cache efficiency.. 

See http://developer.yahoo.com/yui/compressor/ for an example approach to script compression. 
+++++

Best regards,
Bryan Sullivan | AT&T

-----Original Message-----
From: public-bpwg-request@w3.org [mailto:public-bpwg-request@w3.org] On Behalf Of Francois Daoust
Sent: Thursday, March 20, 2008 7:24 AM
To: public-bpwg@w3.org
Subject: BP suggestion: use multipart messages to minimize the number of HTTP requests


Using a multipart message, you can send a main page and say an image and/or a CSS stylesheet, ... within the same HTTP response. This saves some round-trips between the client and the server and thus may be of some use in a high-latency environment.

(It also de facto prevents the browser from fecthing resources in parallel which may not be such a good thing)

The mobile browser is supposed to cache the different parts of the response. I'm not sure mobile browsers all support receiving/parsing multipart responses though.

This could go in 5.5 Conservative use of network traffic. Or it may simply be another example of a way to minimize external script files (although not limited to *script* files)

I found the idea (accidentally) there:
http://developer.openwave.com/dvl/resources/code_corner/technical_notes/multipart.htm
http://www.developershome.com/wap/xhtmlmp/xhtml_mp_tutorial.asp?page=images2


François.

Received on Thursday, 20 March 2008 14:38:06 UTC