FACTOID # 161: If you are looking for work, just go to the Falkland Islands! They have full employment and a labor shortage.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Content negotiation

Content negotiation is a mechanism defined in the HTTP specification that makes it possible to serve different versions of a document (or more generally, a resource) at the same URL, so that user agents can choose which version fit their capabilities the best. One of the most classical uses of this mechanism is to serve an image as both GIF and PNG, so that a browser that doesn't understand PNG can still display the GIF version. To summarize how this works, it's enough to say that user agents are supposed to send an HTTP header (Accept) with the various MIME types they understand and with indications of how well they understand it. Then, the server replies with the version of the resource that fits the user agents' needs. HTTP (for HyperText Transfer Protocol) is the primary method used to convey information on the World Wide Web. ... A Uniform Resource Locator, URL (either pronounced as earl (IPA: [ɜː˞l]; SAMPA: [3:`l]) or spelled out), or Web address, is a standardized address for some resource (such as a document or image) on the Internet (or elsewhere). ... A user agent is the client application used with a particular network protocol; the phrase is most commonly used in reference to those which access the World Wide Web. ... GIF (Graphics Interchange Format) is a bitmap image format that is widely used on the World Wide Web, both for still images and for animations. ... PNG (Portable Network Graphics), sometimes pronounced as ping, is a relatively new bitmap image format that is becoming popular on the World Wide Web and elsewhere. ... Multipurpose Internet Mail Extensions (MIME) is an Internet Standard for the format of e-mail. ...


So, a resource may be available in several different representations. For example, it might be available in different languages or different media types, or a combination. One way of selecting the most appropriate choice is to give the user an index page, and let them select. However it is often possible for the server to choose automatically. This works because browsers can send as part of each request information about the representations they prefer. For example, a browser could indicate that it would like to see information in French, if possible, else English will do. Browsers indicate their preferences by headers in the request. To request only French representations, the browser would send

 Accept-Language: fr 

Note that this preference will only be applied when there is a choice of representations and they vary by language.


As an example of a more complex request, this browser has been configured to accept French and English, but prefer French, and to accept various media types, preferring HTML over plain text or other text types, and preferring GIF or JPEG over other media types, but also allowing any other media type as a last resort: A photo of a flower compressed with successively higher compression ratios from left to right. ...

 Accept-Language: fr; q=1.0, en; q=0.5 Accept: text/html; q=1.0, text/*; q=0.8, image/gif; q=0.6, image/jpeg; q=0.6, image/*; q=0.5, */*; q=0.1 

See also

Apache HTTP Server is an open source HTTP web server for Unix-like systems (BSD, Linux, and UNIX systems), Microsoft Windows, and other platforms. ...

External links

  • Apache Content Negotiation (http://httpd.apache.org/docs/content-negotiation.html)
  • Content negotiation techniques to serve XHTML as text/html and application/xhtml+xml (http://www.w3.org/2003/01/xhtml-mimetype/content-negotiation)
  • XHTML content negotiation through PHP (http://mathibus.com/archive/2005/04/php-xhtml-content-negotiation)

  Results from FactBites:
 
HTTP/1.1: Content Negotiation (904 words)
Agent-driven negotiation is advantageous when the response would vary over commonly-used dimensions (such as type, language, or encoding), when the origin server is unable to determine a user agent's capabilities from examining the request, and generally when public caches are used to distribute server load and reduce network usage.
When a cache is supplied with a form of the list of available representations of the response (as in agent-driven negotiation) and the dimensions of variance are completely understood by the cache, then the cache becomes capable of performing server- driven negotiation on behalf of the origin server for subsequent requests on that resource.
Transparent negotiation has the advantage of distributing the negotiation work that would otherwise be required of the origin server and also removing the second request delay of agent-driven negotiation when the cache is able to correctly guess the right response.
RFC 2295 (rfc2295) - Transparent Content Negotiation in HTTP (12081 words)
Negotiation on the content encoding of a response (gzipped, compressed, etc.) is left outside of the realm of transparent negotiation.
10.8 Negotiation on content encoding Negotiation on the content encoding of a response is orthogonal to transparent content negotiation.
The rules for when a content encoding may be applied are the same as in HTTP/1.1: servers MAY content-encode responses that are the result of transparent content negotiation whenever an Accept-Encoding header in the request allows it.
  More results at FactBites »


 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m