[Pkg-javascript-devel] Bug#979996: libjs-jquery: please use the default extension for precompressed brotli files

Guilhem Moulin guilhem at debian.org
Wed Jan 13 03:55:45 GMT 2021


Had a closer look at this with the help of your links from msg#27.  With
both foo.css.gz and foo.css.br present in a directory, .gz and .br
respectively mapping to gzip and br encoding (and .br to the breton
language too), as Kevin wrote the request fails:

    HEAD /foo.css HTTP/1.1
    Accept: */*
    Accept-Encoding: br
    Accept-Language: en

    HTTP/1.1 406 Not Acceptable
    Date: Wed, 13 Jan 2021 03:06:33 GMT
    Server: Apache/2.4.46 (Debian)
    Alternates: {"foo.css.br" 1 {type text/css} {language br} {encoding br} {length 3}}, {"foo.css.gz" 1 {type text/css} {encoding gzip} {length 32}}
    Vary: negotiate,accept-language,accept-encoding
    TCN: list
    Content-Type: text/html; charset=iso-8859-1

However I still don't understand why this is a blocker.  With the
MultiViews method one accepts to use ‘RemoveType .gz’, why is it not OK
to use ‘RemoveLanguage .br’?

Also, the MultiViews method won't work with /usr/share/javascript/jquery
anyway because jquery.min.js exists, so apache2 won't honor Content-
{Language,Encoding} negotiation and serve that file instead (ie never
pick the compress files from the file system), right?

The mod_brotli configuration snippet you linked to in #972632 works well
on the other hand.  Using mod_rewrite one can emulate negotiation and
point the HTTPd to the uncompressed / gzipped / brotli-compressed file
depending on the value of the ‘Accept-Encoding’ header.  When using .br
suffixes the file is served with ‘Content-Language: br’ header, which I
guess is why you changed the extension?  IMHO adding ‘RemoveLanguage
.br’ in the <FilesMatch/> of a system-provided snippet would be an OK
workaround, but whatever, I guess using .brotli suffixes for apache2 is
fine too :-)

On Tue, 12 Jan 2021 at 23:32:29 +0100, Guilhem Moulin wrote:
> Keeping the above snippet, would apache complain about the mere presence
> of a jquery.min.js.br file alongside the jquery.min.js.brotli?

Given Content-{Language,Encoding,Type,…} is unusable here (because the
uncompressed file is present as well), I was unable to find any downside
of doing that (aside from the fact that symlink resolution now needs to
be enabled).

> If not, then how about shipping both?

:-]
-- 
Guilhem.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20210113/8da3ee99/attachment.sig>


More information about the Pkg-javascript-devel mailing list