Web Servers on Unix and Linux - Apache 1.3 content negotiation

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > September 2004 > Apache 1.3 content negotiation





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Apache 1.3 content negotiation
Mike Mimic

2004-09-23, 9:20 am

Hi!

I am testing content negotiation on my server and I
have made some test pages. But I got a problem.

I have made three files: test.html.en, test.html.fr,
test.html.it and I am trying to access test.html URL.

The problem is that with the same browser configuration
(Mozilla, "en" is set as preffered language) server
sends sometimes English version (as it should) but
sometimes it sends 406 error with links to all three
files (including English). I understand the 406 error
and that it is normal that it sends it when it cannot
match a language to a file.

That is really strange as I do not change anything
between requests.

It is not proxy problem (I do not use it) or cache problem
as I sniffed my connection and to exactly the same GET
request from my browser server sends once html file and
once 406 error.

I have not found any pattern. It seems random.

And ideas?


Mike
Alan J. Flavell

2004-09-23, 9:20 am

On Sun, 19 Sep 2004, Mike Mimic wrote:

> The problem is that with the same browser configuration
> (Mozilla, "en" is set as preffered language) server
> sends sometimes English version (as it should) but
> sometimes it sends 406 error with links to all three
> files (including English). I understand the 406 error
> and that it is normal that it sends it when it cannot
> match a language to a file.


Have you found my page
http://ppewww.ph.gla.ac.uk/~flavell/www/lang-neg.html
on this general topic?

I don't know the precise answer to your problem; but I think
if you follow the suggestions on this page, then you will be able
to get the results you wanted (even if you still don't understand
what was going wrong before ;-)

(Are you using MultiViews, or a type-map?)
Mike Mimic

2004-09-23, 9:20 am

Hi!

Alan J. Flavell wrote:
> On Sun, 19 Sep 2004, Mike Mimic wrote:
>
> Have you found my page
> http://ppewww.ph.gla.ac.uk/~flavell/www/lang-neg.html
> on this general topic?


Yes. I have read it. And I have also read Apache documentation
on the topic.

> (Are you using MultiViews, or a type-map?)


MultiViews.

I have discovered that after fresh restart (of Apache) everything
is working OK. But after some time, minute or two, (I do not why)
this two requests have different responses (first English (because
of LanguagePriority) and second 406):

GET / HTTP/1.1
Host: my.host.com
Accept: */*
Keep-Alive: 300
Connection: keep-alive

GET / HTTP/1.1
Host: my.host.com
Accept: */*;q=0.1
Keep-Alive: 300
Connection: keep-alive


Mike
Alan J. Flavell

2004-09-23, 9:20 am

On Sun, 19 Sep 2004, Mike Mimic wrote:

> MultiViews.
>
> I have discovered that after fresh restart (of Apache) everything
> is working OK. But after some time, minute or two, (I do not why)
> this two requests have different responses (first English (because
> of LanguagePriority) and second 406):
>
> GET / HTTP/1.1
> Host: my.host.com
> Accept: */*
> Keep-Alive: 300
> Connection: keep-alive
>
> GET / HTTP/1.1
> Host: my.host.com
> Accept: */*;q=0.1
> Keep-Alive: 300
> Connection: keep-alive


Boggle. I don't have an explanation (at least, not yet, nor have I
any confidence that I'll be able to give one), but can you, at least,
say what the "Vary:" response header contained in each case?
Mike Mimic

2004-09-23, 9:20 am

Hi!

Alan J. Flavell wrote:
> Boggle. I don't have an explanation (at least, not yet, nor have I
> any confidence that I'll be able to give one), but can you, at least,
> say what the "Vary:" response header contained in each case?


Of coure. For working one:

Vary: negotiate,accept-language
TCN: choice

For other one:

Vary: negotiate,accept-language
TCN: list

If you need any logs or anything (debug mode?) ...


Mike
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com