Re: [whatwg] APIs to interrogate default outgoing HTTP headers, i.e. Accept-Encoding

Ron Waldon <jokeyrhyme@gmail.com> writes:

> I posted this at http://discourse.wicg.io/ a long time ago and forgot to
> email the list about it, so here goes...
>
> ## original post
>
> There's currently no good way to determine whether or not a browser /
> environment supports GZIP-deflated content entirely from the front-end.
> Servers can interrogate the Accept-Encoding header when they receive the
> request, but client-side JavaScript cannot see this value at all.
>
> This is important when using a CDN that doesn't facilitate selection of
> appropriately deflated content (e.g. AWS CloudFront). I've had projects
> where the initial HTML content is dynamically generated only so that the
> server can pass the Accept-Encoding header back to the client. That way,
> the client can adjust the other URLs it uses to pick pre-GZIPed files, e.g.
> blah.js.gz instead of blah.js all the time.

I do not understand that use case. It reads incredibly convoluted to
me. The UA controls the transport anyway – it should not make any
practical difference to a script how the data is transmitted.

Btw, why can AWS CloudFront not into compressed content?

-- 
Nils Dagsson Moskopp // erlehmann
<http://dieweltistgarnichtso.net>

Received on Monday, 10 August 2015 22:31:40 UTC