On 19 January 2011 08:44, Ian Stuart <ian.stu...@ed.ac.uk> wrote: > On 19/01/11 08:06, Richard Jones wrote: > >> and your content negotiation header says: >> >> Accept: A; q=1.0, B; q=0.8 >> Accept-Packaging: Z; q=1.0, X; q=1.0 >> >> Which combination do you return? >> > I agree its not a clear-cut case..... however it also has to be said that > the content negotiation header isn't helping by declaring two options to be > of equal "value" > > I would say: > A+Z, then A+X, then B+Z, then B+X > > .... FIFO-style > > (after all, if you have a preference for order, try: > > Accept-Packaging: X; q=1.0, Z; q=1.0 > > instead) > > > Even under the concept of a combined Accept model, what do you do when you > receive > > Accept-Media-Feature: A(Z); q=1.0, A(X); q=1.0, B(Z); q=0.8, B(X); q=0.8 > > It's complicated even beyond what you are suggesting. What if as the server, you consider your support of format A to only be partial - say q=0.6 equivalent? Or if your support of format B is also only q=0.8 equivalent?
Basically, you end up with two sides negotiating with no [declared] perfect support in common. Is 'perfect' support on one side and poor support on the other better or worse than so/so support on either side? So what do you do when you receive the kind of negotiation that you mention? Answer: whatever you choose to do. You should use the quality indications to steer you to a format/packaging that is better supported by the client. But you can weight your choice with whatever factors you choose to use. Is it twice as fast/efficient for you to return packaging X? Then return A(X) - the client has declared that it doesn't care which of A(Z) or A(X) it gets, it's only said that it would prefer to get one of them instead of B(Z). Content negotiation isn't an exact discipline, because you are having to make generalisations. How do you express that in one metadata schema you only support 10% of the fields, but they are far more important than the 95% of fields you support in another? Or that there is such a vast difference in resources used that you don't care about a 5% loss in quality to take a JPEG rather than a TIF? All you can do is rank them as best you can for the general case, and that sometimes that might mean you get a format that isn't optimal for that particular case. G