Auto Content Negotiation
Content negotiation, provided by mod_negotiation (through the use of MultiViews) in the Apache web server. This module can tell what the user wants if they just "GET /index" when the files index.html, index.gif, and index.jpg are in that directory.
Why is this important? It means that a maintainer can make links in their pages to just the file's basename (without the extension) to let the user's browser tell the webserver what they want more. Take the example below:
Here we see a directory listing of three images:
-rwxr--r-- 1 root root 1440054 Feb 14 14:42 mycity.bmp -rw-r--r-- 1 root root 156803 Feb 14 14:43 mycity.jpg -rw-r--r-- 1 root root 680391 Feb 14 14:43 mycity.png
(fig. 1)
A 1.44MB bitmap, a 156KB jpeg, and a 680KB png. If the user sends "GET mycity" along with a header which says "I can understand bitmap, jpeg, and png graphics, but if all three are available I want jpegs" the webserver can give the browser that image.
Content negotiation, at its core, is about trying to guess what the user wants given multiple resources for a given URI, be it different image formats or translations of a webpage.
An added bonus, using MultiViews makes managing your website much easier. Let's say that you were using static .html pages and your time became too limited and you had to move to an automated method of generating pages, such as using .php pages or .asp or .cgi. This is bad news. You've got to totally redo all of your pages and links and links TO your pages, imagine having several thousand pages to change. Ick!
Created: 14 Apr 03 - Modified: 25 Jan 06. Validate
© 2002-2008
Lisa Seelye.