You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Christoph Schneegans <Ch...@Schneegans.de> on 2002/02/13 19:44:06 UTC

qs values in conjunction with MultiViews

Hi!

<http://httpd.apache.org/docs/content-negotiation.html> explains how to
use qs parameters in a type map file to assign a source quality to the
different variants. It does not explain how to use qs values in
conjunction with MultiViews, and
<http://bugs.apache.org/index.cgi/full/3191> and
<http://bugs.apache.org/index.cgi/full/2965> complain that there's no way
to set these values.

However, it seems to be possible, using the AddType directive:

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

This works as expected but I'm concerned about the Content-Type headers
that are transmitted to the client:

  Content-Type: image/svg;qs=0.85
  Content-Type: image/png;qs=0.7
  Content-Type: image/jpeg;qs=0.8

In contrast to negotiation via type map, the qs values are included in
the response header.

<http://www.apacheweek.com/features/negotiation> says:

| The source quality is assumed to be 1.000 for all files (this can
| actually be set on the mime type, like "text/html;qs=0.5" but this
| confuses most browsers so is probably best not used).

I've tested with several browsers -- Opera 3.61, 5.12 and 6.01, Mozilla
0.9.8, links, lynx, IE6, Netscape 3.0.4 and 4.78, Amaya 4.3.2 and 5.3
don't complain. Does anybody know if there's a browser that can't handle
qs values?

The next question is if qs values are formally allowed in the
Content-Type header. According to RFC 2616, I think they are not, so
Apache should remove them. Or is this just an undesired side effect of
type map negotiation, i.e. are qs values not designed to work with
MultiViews? Any comments are greatly appreciated.


Best regards,
Christoph Schneegans

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

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: qs values in conjunction with MultiViews

Posted by Christoph Schneegans <Ch...@Schneegans.de>.
Ken Coar wrote:

> My impression is that HTTP does not forbid qvalue parameters
> in Content-Type fields, but they may be of limited utility.
> They *do* make sense in at least one situation: a resource
> with an overall media type of multipart/alternative.

I don't expect clients or proxies to have a benefit of qs values. But
there's no doubt that they're very useful for server side content
negotiation. Without qs values in the AddType directive, you would need
.var files to assign a source quality.

For example, I'd like to use

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

to serve XHTML documents as "application/xhtml+xml" to browsers that
accept this MIME type (i.e. Mozilla). The qs values are strictly
necessary for browsers like IE that contain "*/*" in their Accept
header but don't support xHTML.

BTW, you can see this example at
<http://schneegans.de/temp/qs-multiviews>. Using IE, you'll get the 
HTML variant. Using Mozilla, you'll get the XHTML variant.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: qs values in conjunction with MultiViews

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Christoph Schneegans wrote:
> 
> > Unfortunately, content negotiation and multiviews are a very tricky
> > area, so there aren't many people willing to muck with the code.
> 
> Hm, I've found examples from 1996 that use qs values in AddType -- I
> think it's time to fix this problem.

My impression is that HTTP does not forbid qvalue parameters
in Content-Type fields, but they may be of limited utility.
They *do* make sense in at least one situation: a resource
with an overall media type of multipart/alternative.  Different
qvalues could be used to help select the appropriate alternative.
It is *possible* that a single-part document may carry a qvalue
that some caching engine may use to check for freshness, but
I think that's rather far out and unlikely, given all the other
axes for such checks, and I'm not sure (haven't checked) whether
HTTP even permits it.
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"Millennium hand and shrimp!"

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: qs values in conjunction with MultiViews

Posted by Christoph Schneegans <Ch...@Schneegans.de>.
Joshua Slive wrote:

> This same question recently came up in the comp.infosystems.www.servers.unix
> newsgroup.

Yes, I was involved in that thread.

> We didn't come up with a good answer.

That's why I'm asking my question here. :-)

> If you want to see it fixed, I suggest you try to start a discussion on
> dev@httpd.apache.org.

Okay, I'll do that.

> Unfortunately, content negotiation and multiviews are a very tricky
> area, so there aren't many people willing to muck with the code.

Hm, I've found examples from 1996 that use qs values in AddType -- I
think it's time to fix this problem.

Thanks for your answer.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: qs values in conjunction with MultiViews

Posted by Joshua Slive <jo...@slive.ca>.

> -----Original Message-----
> From: Christoph Schneegans [mailto:Christoph@Schneegans.de]

> The next question is if qs values are formally allowed in the
> Content-Type header. According to RFC 2616, I think they are not, so
> Apache should remove them. Or is this just an undesired side effect of
> type map negotiation, i.e. are qs values not designed to work with
> MultiViews? Any comments are greatly appreciated.

This same question recently came up in the comp.infosystems.www.servers.unix
newsgroup.  We didn't come up with a good answer.  It sounds like apache
isn't doing the right thing here.

If you want to see it fixed, I suggest you try to start a discussion on
dev@httpd.apache.org.  Unfortunately, content negotiation and multiviews are
a very tricky area, so there aren't many people willing to muck with the
code.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org