Re: HTTP Link header?

[email protected] Thu, 29 Oct 2009 22:02:37 +0000 (UTC)
Newsgroups gmane.network.gnutella.devel
Organization Home, Grenoble, France
Message-ID <[email protected]>
Quoting Arne Babenhauserheide <[email protected]> from ml.gnutella.dev-forum:
:I just found a blog post about the HTTP "Link" header: 
:
:- http://changelog.ca/log/2006/06/17/gnutella_does_not_need_the_x-
:alt_http_header
:
:Example: 
:
:Link: <http://192.0.2.44:6346/uri-
:res/N2R?urn:sha1:4727ac07221adba9875a894738eeff9cc7fdd214> ; rel="alternate"
:    
:Would there be merit in switching to that standard header? 

There could be a reason if we were still using the old
X-Gnutella-Alternate-Location header.  But we switched to X-Alt
for one single reason: bandwidth saving in the header exchanges.

Contrary to a web server where HTTP headers are exchanged once per
file downloaded, the swarming nature of Gnutella makes bandwidth
consideration important.

Also, the semantics of Link are open: one can express various things
with a Link header and create relations into closely related but not
necessarily identical items.

By comparison, X-Alt lists hosts that can supply an exact replicate of
the resource.

Following is the full Link specification from HTTP/1.1. Note that the
values of the link parameters are completely open and would therefore
need to be standardized for Gnutella to be able to emit these headers
and be understood properly.

19.6.2.4 Link

   The Link entity-header field provides a means for describing a
   relationship between two resources, generally between the requested
   resource and some other resource. An entity MAY include multiple Link
   values. Links at the metainformation level typically indicate
   relationships like hierarchical structure and navigation paths. The
   Link field is semantically equivalent to the <LINK> element in
   HTML.[5]

          Link           = "Link" ":" #("<" URI ">" *( ";" link-param )

          link-param     = ( ( "rel" "=" relationship )
                             | ( "rev" "=" relationship )
                             | ( "title" "=" quoted-string )
                             | ( "anchor" "=" <"> URI <"> )
                             | ( link-extension ) )

          link-extension = token [ "=" ( token | quoted-string ) ]

          relationship   = sgml-name
                         | ( <"> sgml-name *( SP sgml-name) <"> )

          sgml-name      = ALPHA *( ALPHA | DIGIT | "." | "-" )

   Relationship values are case-insensitive and MAY be extended within
   the constraints of the sgml-name syntax. The title parameter MAY be
   used to label the destination of a link such that it can be used as
   identification within a human-readable menu. The anchor parameter MAY
   be used to indicate a source anchor other than the entire current
   resource, such as a fragment of this resource or a third resource.

   Examples of usage include:

       Link: <http://www.cern.ch/TheBook/chapter2>; rel="Previous"

       Link: <mailto:[email protected]>; rev="Made"; title="Tim Berners-Lee"

   The first example indicates that chapter2 is previous to this
   resource in a logical navigation path. The second indicates that the
   person responsible for making the resource available is identified by
   the given e-mail address.

So I do not think it would be a good idea to support Link when talking to
another Gnutella servent.  When talking to a browser, it could make sense
to emit it, provided the value of the "rel" parameter is standard and
unambiguous.  We would not want some servents to say rel="alt", others
rel="alt-loc", others rel="x-alt"... you get the point.

Raphael