You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Daniel Aleksandersen <al...@runbox.com> on 2008/03/11 06:28:00 UTC

[users@httpd] Content negotiation and the Vary header

Hi list,

Just a quick question regarding the HTTP/1.1 Vary header and content 
negotiation. Must the Vary header contain all “content variables” that 
affects the content negotiation?

For example, say that I have a resource at /location which a user requsts 
in Norwegian Bokmål and html. The user would get /location.html.nb 
acompanied by a Vary header containing «negotiation accept-language 
accept-type». But is the last bit really nessesary for a resource that is 
only available in one format?

Another question regarding that header… What are the different parameters 
for it? I have not been able to figure out from reading—meaning skimming 
trough—the RFCs.
-- 
Daniel Aleksandersen – http://www.opensource-notebook.com/

---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Content negotiation and the Vary header

Posted by Nick Kew <ni...@webthing.com>.
On Tue, 11 Mar 2008 06:28:00 +0100
Daniel Aleksandersen <al...@runbox.com> wrote:

> Hi list,
> 
> Just a quick question regarding the HTTP/1.1 Vary header and content 
> negotiation. Must the Vary header contain all “content variables”

What's a "content variable"?  Vary lists request headers.

> that affects the content negotiation?
> 
> For example, say that I have a resource at /location which a user
> requsts in Norwegian Bokmål and html. The user would
> get /location.html.nb acompanied by a Vary header containing
> «negotiation accept-language accept-type». But is the last bit really
> nessesary for a resource that is only available in one format?

There's no "accept-type".  I suggest you read the RFC rather than
make wild guesses.

But anyway, when URL /foo is resolved to file $path/foo.html.nb ,
mod_negotiation assumes there could be other negotiated options
for either or both of .html and .nb, and uses Vary to tell the
client.  It may not always be necessary, but it's safe.
Even if there's nothing there now, the fact you're using content 
negotiation suggests there might be at other times.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org