AddType with source quality (qs=) values? (Apache?)

AddType with source quality (qs=) values? (Apache?)

Post by Alan J. Flavel » Fri, 21 Dec 2001 05:13:04



Greetings,

I've come across a couple of places where people clearly believe that
AddType directives in Apache can provide source quality values.

I've seen no examples of this in the documentation (I looked at 2.0
as well as at 1.3) nor specific reference to it in the CHANGES logs.

Were they confused, or am I missing something?

The first of the places I found (no URL, sorry) went like this

        Options +MultiViews
        AddType application/xhtml+html .xhtml; q=1.0
        AddType text/html .html; q=0.9

This made me extra sceptical, as this is attempting to specify the
source quality (qs) but uses the parameter name q, which normally
specifies the client's preference.  I tried this a bit (in 1.3.20) and
it didn't seem to have any effect (nor did it report an error,
however).

The second place that I found was this

http://lists.w3.org/Archives/Public/www-mobile/2001May/0006.html

(where the context is less obvious, I admit) with examples like this

  AddType image/svg;qs=0.85                             svg svgz
  AddType image/png;qs=0.7                              png
  AddType image/jpeg;qs=0.8                             jpg jpeg

When I was looking at negotiated content in Apache, I had been unable
to find a way for MultiViews to take account of source quality, and I
therefore thought that using a typemap was then the only way to get
source quality taken into account.

If there's anything in either of these snippets mentioned above,
then it would seem that Apache might have such a mechanism already?
(albeit at least one of the snippets presumably has to be wrong in
details).

Does Apache have such an option?  Does it really participate in the
content negotiation?  Have I missed the documentation for it?

thanks

 
 
 

AddType with source quality (qs=) values? (Apache?)

Post by Alan J. Flavel » Mon, 11 Feb 2002 04:08:47


[a courtesy copy of this Usenet posting is being sent to Greg Roelofs]

On Dec 19, I attempted to start a Usenet discussion here on this topic
which, in the event, seems to have sunk without trace.  My apologies,
but I'm seriously interested in sorting this out: for easy reference
I'm taking the liberty of quoting my original query below.

Although I had been unable to find any relevant Apache bug reports,
I've since discovered that there are in fact two such reports, as far
back as 1998:
http://bugs.apache.org/index.cgi/full/3191
http://bugs.apache.org/index.cgi/full/2965

(sorry, I really can't explain why my earlier search had failed to
find those)

to which the conclusion from the Apache developers had been:

 We've currently no firm plans to add such a
 functionality to Apache.
 I'm suspending your change request so that it can
 be reviewed at a later time.

This was my question:

Quote:> I've come across a couple of places where people clearly believe that
> AddType directives in Apache can provide source quality values.

> I've seen no examples of this in the documentation (I looked at 2.0
> as well as at 1.3) nor specific reference to it in the CHANGES logs.

> Were they confused, or am I missing something?

> The first of the places I found (no URL, sorry) went like this

>         Options +MultiViews
>         AddType application/xhtml+html .xhtml; q=1.0
>         AddType text/html .html; q=0.9

> This made me extra sceptical, as this is attempting to specify the
> source quality (qs) but uses the parameter name q, which normally
> specifies the client's preference.  I tried this a bit (in 1.3.20) and
> it didn't seem to have any effect (nor did it report an error,
> however).

> The second place that I found was this

> http://lists.w3.org/Archives/Public/www-mobile/2001May/0006.html

> (where the context is less obvious, I admit) with examples like this

>   AddType image/svg;qs=0.85                             svg svgz
>   AddType image/png;qs=0.7                              png
>   AddType image/jpeg;qs=0.8                             jpg jpeg

> When I was looking at negotiated content in Apache, I had been unable
> to find a way for MultiViews to take account of source quality, and I
> therefore thought that using a typemap was then the only way to get
> source quality taken into account.

> If there's anything in either of these snippets mentioned above,
> then it would seem that Apache might have such a mechanism already?
> (albeit at least one of the snippets presumably has to be wrong in
> details).

> Does Apache have such an option?  Does it really participate in the
> content negotiation?  Have I missed the documentation for it?

So, are the people who believe this to be working misguided, or
what?  I'm still confused.

best regards

 
 
 

AddType with source quality (qs=) values? (Apache?)

Post by Rich Bowe » Mon, 11 Feb 2002 07:14:16



> [a courtesy copy of this Usenet posting is being sent to Greg Roelofs]

> On Dec 19, I attempted to start a Usenet discussion here on this topic
> which, in the event, seems to have sunk without trace.  My apologies,
> but I'm seriously interested in sorting this out: for easy reference
> I'm taking the liberty of quoting my original query below.

> Although I had been unable to find any relevant Apache bug reports,
> I've since discovered that there are in fact two such reports, as far
> back as 1998:
> http://bugs.apache.org/index.cgi/full/3191
> http://bugs.apache.org/index.cgi/full/2965

>> The first of the places I found (no URL, sorry) went like this

>>         Options +MultiViews
>>         AddType application/xhtml+html .xhtml; q=1.0
>>         AddType text/html .html; q=0.9

>> The second place that I found was this

>> http://lists.w3.org/Archives/Public/www-mobile/2001May/0006.html

>> (where the context is less obvious, I admit) with examples like this

>>   AddType image/svg;qs=0.85                             svg svgz
>>   AddType image/png;qs=0.7                              png
>>   AddType image/jpeg;qs=0.8                             jpg jpeg

> So, are the people who believe this to be working misguided, or
> what?  I'm still confused.

I believe that they were simply misguided.

Using the second syntax listed here causes a Content-Type of
"image/png;qs=0.7", and using the first syntax appears to cause the
directive to get ignored entirely.

Sorry, I was pretty sure I had responded with this same answer the first
time you posted.

--
Rich Bowen
ApacheAdmin.com

 
 
 

AddType with source quality (qs=) values? (Apache?)

Post by Christoph Schneegan » Tue, 12 Feb 2002 00:29:25



>>> The first of the places I found (no URL, sorry) went like this

>>>         Options +MultiViews
>>>         AddType application/xhtml+html .xhtml; q=1.0
>>>         AddType text/html .html; q=0.9

>>> The second place that I found was this (...)

>>>   AddType image/svg;qs=0.85                             svg svgz
>>>   AddType image/png;qs=0.7                              png
>>>   AddType image/jpeg;qs=0.8                             jpg jpeg

> Using the second syntax listed here causes a Content-Type of
> "image/png;qs=0.7",

Yes, indeed, but qs-values do affect content negotiation via
multiviews. Please check out <http://schneegans.de/temp/qs-multiviews>.
The .htaccess directives are

  Options +MultiViews
  AddType text/html;charset=iso-8859-1;qs=1.0 .html
  AddType application/xhtml+xml;iso-8859-1;qs=0.95 .xhtml

A request with Mozilla's

  Accept: text/xml, application/xml, application/xhtml+xml,
    text/html;q=0.9, image/png, image/jpeg, image/gif;q=0.2,
    text/plain;q=0.8, text/css, */*;q=0.1

returns

  Content-Type: application/xhtml+xml;iso-8859-1;qs=0.95
  Content-Location: qs-multiviews.xhtml

while a request with IE's

  Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
    application/vnd.ms-powerpoint, application/vnd.ms-excel,
    application/msword, */*

or Opera's

  Accept: text/html, image/png, image/jpeg, image/gif, image/x-xbitmap,
    */*

returns

  Content-Type: text/html; charset=iso-8859-1; qs=1.0
  Content-Location: qs-multiviews.html

The next question would be if qs-values are allowed in the Content-
Type-header. According to RFC2616, I think they are not.

Quote:> and using the first syntax appears to cause the directive to get
> ignored entirely.

No, it works, because

  AddType application/xhtml+html .xhtml; q=1.0

is equivalent to

  AddType application/xhtml+xml .xhtml;
  AddType application/xhtml+xml q=1.0

Of course, nobody would name files "index.xhtml;" or "sitemap.q=1.0".

--
<http://schneegans.de/>

 
 
 

AddType with source quality (qs=) values? (Apache?)

Post by Alan J. Flavel » Wed, 13 Feb 2002 04:34:34


On Feb 10, Christoph Schneegans inscribed on the eternal scroll:

(quoting something that I had quoted from elsewhere:)

Quote:> >>>         Options +MultiViews
> >>>         AddType application/xhtml+html .xhtml; q=1.0
> >>>         AddType text/html .html; q=0.9

I realise now just how wrong that was: my suspicion had fallen on the
use of 'q=' rather than 'qs=' as I had expected; but now that it's
pointed out, clearly the position of this attribute in the AddType
directive is the worse error, and makes the thing meaningless.  Let's
discard that as bogus and concentrate on the other option for now.

Quote:> >>>   AddType image/svg;qs=0.85                             svg svgz
> >>>   AddType image/png;qs=0.7                              png
> >>>   AddType image/jpeg;qs=0.8                             jpg jpeg

Rich Bowen commented:

Quote:> > Using the second syntax listed here causes a Content-Type of
> > "image/png;qs=0.7",

Indeed it does.

Quote:> Yes, indeed, but qs-values do affect content negotiation via
> multiviews. Please check out <http://schneegans.de/temp/qs-multiviews>.

Well, we don't seem to have been able to persuade anyone to admit that
this is deliberate, do we?  I'm suspecting that this falls into the
machinery that's been implemented in Apache (mod_negotiation) for
handling Content-type lines from a typemap file, and that its
operation here is an undocumented side-effect.  But that's still just
a guess, unless/until developer(s) care to comment on this.

[...]

Quote:> The next question would be if qs-values are allowed in the Content-
> Type-header. According to RFC2616, I think they are not.

Reading the runes again, I'm puzzled over this issue.  I've tried to
construe RFC2616 as not permitting this, but I'm not sure that I can.
Whichever way the argument goes about what RFC2616 does or does not
allow, however, I don't think it would be _advisable_ to have these
;qs= values going out on Content-type headers, so I guess the bottom
line is the same.

I think it's time to restate the problem that we were trying to
address when we started digging this particular hole...  but that
calls for another posting and a modified Subject, I think.

best regards

 
 
 

1. Apache AddType in .htaccess file.

Hello every one:
I want to allow people to download test.pdf file from a web directory rather
than view it.  To make the files download automatically, I place it in a
directory with a .htaccess file containing the following:

AddType application/octet-stream pdf
AddType application/x-download .PDF .pdf  
AddType application/pdf PDF
AddType image/pdf PDF

I made a link to a.pdf file from the web page. It lets me download the image
with
netscape but with AOL4 or IE4 the a.pdf file opens inside the browser with
Acrobat Reader. How can I have the files download automatically?  If you have
any thoughts, please let me know.

Thank you.
-Shamim Patwary

2. Newbie RPM Problem

3. Apache: AddType question

4. Green Card Lottery- Final One?

5. Does AddType change character encoding in Apache?

6. Wash.DC user group?

7. Apache Directives AddType vs AddHandler

8. Which gdb version for ELF core dumps?

9. Apache: *only* non-dotted "extensions" in AddType?

10. Apache: using AddType in .htaccess?

11. Open Source higher quality than commercial REASONING.com

12. Study lauds open-source code quality

13. Sources for Data Quality 8mm tapes?