Content negotiation is where you provide the server with different file formats for the same resource (variants), and the server will return the most appropriate version to the client.
For example, you may have two versions of an inlined image, a GIF version and a JPEG version. The JPEG version might be of higher quality and smaller, but you need to provide the GIF version to provide a service to clients using older Mosaic style browsers which do not support inline JPEGs.
If you provide both variants to the server and enable content negotiation, then the server will automatically send the GIF image to the older browser and the JPEG image to the browsers that can support it.
Browser negotiation is where you provide two different versions of your HTML files, a plain HTML/2.0 version and a Netscape enhanced version. The server will automatically send the enhanced page to Netscape clients and transparently give older clients the HTML/2.0 versions of your pages.
Never: | No dynamic negotiation is enabled |
On variant files: | Only negotiate on variant files |
Always: | Always negotiate |
The first option will disable dynamic negotiation completely, the other two determine how you the server finds the variant files for the requested resource.
A variant file is a small text file which explicitly states the different variants available for the resource in RFC822 format, along with a preference value. The example is:
URI: url; vary="type" URI: url.jpg Content-type: image/jpeg; qs=0.8 URI: url.gif Content-type: image/gif; qs=0.5 URI: readme.txt Content-type: text/plain; qs=0.3This file defines three variants, a jpeg, a gif and a text version. When the client requests this variant file, then the one of the three variants that best matches the client will be returned. For example, if the client can handle all 3 variants, then the jpeg will be returned because it has the highest quality rating (0.8 in this example).
You will probably want to add an extra entry to the Index Types field also on the advanced configuration page, of the name `index', so that when the client requests a directory, the server will dynamically return either the index.html or index.nhtml file depending on the client. For example, you would alter the default value of the index types field from index.cgi,index,index.html,index.shtml to index.cgi,index,index,index.html,index.shtml