W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2010

[ProgressEvents] How to deal with compressed transfer encodings

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 23 Nov 2010 13:41:00 -0800
Message-ID: <AANLkTikVx6kmu2cTZ2mvagZ6h52pACj3s6MeQ1foE+J0@mail.gmail.com>
To: Webapps WG <public-webapps@w3.org>
Hi All,

How should ProgressEvents deal with compressed transfer encodings? The
problem is that the Content-Length header (if I understand things
correctly) contains the encoded number of bytes, so we don't have
access to the total number of bytes which will be exposed to the user
until it's all downloaded. I can see several solutions:

A) Set "total" to 0, and "loaded" to the number of decompressed bytes
downloaded so far
B) Set "total" to the contents of the Content-Length header and
"loaded" the number of compressed bytes downloaded so far
C) Like A, but also expose a percentage downloaded which is based on
the compressed data

B seems spec-wise the simplest, but at least gecko doesn't expose the
compressed number of bytes downloaded, not sure about other HTTP
libraries. It also has the downside that .loaded doesn't match
.responseText.length

C seems the most confusing for authors and the one I like the least.

/ Jonas
Received on Tuesday, 23 November 2010 21:42:07 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:42 GMT