<?xml version="1.0" encoding="US-ASCII"?>

<!-- This template is for creating an Internet Draft using xml2rfc,

     which is available here: http://xml.resource.org. -->

<!-- add baseURL http://xml.resource.org/authoring/ here -->

<!DOCTYPE rfc SYSTEM "http://xml.resource.org/authoring/rfc2629.dtd" [

<!-- One method to get references from the online citation libraries.

     There has to be one entity for each item to be referenced. 

     An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC2616 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2616.xml">

<!ENTITY RFC1123 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1123.xml">

<!ENTITY RFC4287 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4287.xml">

<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">

<!ENTITY RFC5829 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5829.xml">

<!ENTITY RFC5988 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5988.xml">

<!ENTITY RFC4151 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4151.xml">

<!ENTITY RFC5785 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5785.xml">

<!ENTITY RFC6415 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6415.xml">

<!ENTITY I-D.masinter-dated-uri SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-masinter-dated-uri-10.xml">

<!ENTITY I-D.ietf-core-link-format SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-core-link-format-12.xml">

]>

<!-- add baseURL http://www.mementoweb.org/guide/rfc/ID/ here, change xslt to xsl -->

<?xml-stylesheet type='text/xsl' href='http://www.mementoweb.org/guide/rfc/ID/rfc2629.xsl' ?>

<!-- used by XSLT processors -->

<!-- For a complete list and description of processing instructions (PIs), 

     please see http://xml.resource.org/authoring/README.html. -->

<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.

     (Here they are set differently than their defaults in xml2rfc v1.32) -->

<?rfc strict="yes" ipr="trust200902" ?>

<!-- give errors regarding ID-nits and DTD validation -->

<!-- control the table of contents (ToC) -->

<?rfc toc="yes"?>

<!-- generate a ToC -->

<?rfc tocdepth="4"?>

<!-- the number of levels of subsections in ToC. default: 3 -->

<!-- control references -->

<?rfc symrefs="yes"?>

<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->

<?rfc sortrefs="yes" ?>

<!-- sort the reference entries alphabetically -->

<!-- control vertical white space 

     (using these PIs as follows is recommended by the RFC Editor) -->

<?rfc compact="yes" ?>

<!-- do not start each main section on a new page -->

<?rfc subcompact="no" ?>

<!-- keep one blank line between list items -->

<!-- end of list of popular I-D processing instructions -->

<rfc category="info" docName="draft-vandesompel-memento-04" ipr="trust200902">

  <!-- category values: std, bcp, info, exp, and historic

     ipr values: full3667, noModification3667, noDerivatives3667

     you can add the attributes updates="NNNN" and obsoletes="NNNN" 

     they will automatically be output with "(if approved)" -->



  <!-- ***** FRONT MATTER ***** -->



  <!-- ***** FRONT MATTER ***** -->



  <front>

    <!-- The abbreviated title is used in the page header - it is only necessary if the 

         full title is longer than 39 characters -->



    <title abbrev="HTTP Memento">HTTP framework for time-based access to resource states -- Memento</title>



    <!-- add 'role="editor"' below for the editors if appropriate -->



    <!-- Another author who claims to be an editor -->

    <author fullname="Herbert VandeSompel" initials="H." surname="VandeSompel">
      <organization>Los Alamos National Laboratory</organization>
      <address>
        <postal>
          <street>PO Box 1663</street>
          <!-- Reorder these if your country does things differently -->
          <city>Los Alamos</city>
          <region>New Mexico</region>
          <code>87545</code>
          <country>USA</country>
        </postal>
        <phone>+1 505 667 1267</phone>
        <email>hvdsomp@gmail.com</email>
		<uri>http://public.lanl.gov/herbertv/</uri>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <author fullname="Michael Nelson" initials="M.L." surname="Nelson">
      <organization>Old Dominion University</organization>
      <address>
        <postal>
          <street></street>
          <!-- Reorder these if your country does things differently -->
          <city>Norfolk</city>
          <region>Virginia</region>
          <code>23529</code>
          <country>USA</country>
        </postal>
        <phone>+1 757 683 6393</phone>
        <email>mln@cs.odu.edu</email>
		<uri>http://www.cs.odu.edu/~mln/</uri>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <author fullname="Robert Sanderson" initials="R.D." surname="Sanderson">
      <organization>Los Alamos National Laboratory</organization>
      <address>
        <postal>
          <street>PO Box 1663</street>
          <!-- Reorder these if your country does things differently -->
          <city>Los Alamos</city>
          <region>New Mexico</region>
          <code>87545</code>
          <country>USA</country>
        </postal>
        <phone>+1 505 665 5804</phone>
        <email>azaroth42@gmail.com</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <date month="May" year="2012" />

    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 

         in the current day for you. If only the current year is specified, xml2rfc will fill 

	 in the current day and month for you. If the year is not the current one, it is 

	 necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 

	 purpose of calculating the expiry date).  With drafts it is normally sufficient to 

	 specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>General</area>

    <workgroup>Internet Engineering Task Force</workgroup>

    <!-- WG name at the upperleft corner of the doc,

         IETF is fine for individual submissions.  

	 If this element is not present, the default is "Network Working Group",

         which is used by the RFC Editor as a nod to the history of the IETF. -->

    <keyword>HTTP</keyword>
    <keyword>content negotiation</keyword>
    <keyword>datetime negotiation</keyword>
    <keyword>resource versions</keyword>
    <keyword>archival resources</keyword>
    <keyword>Memento</keyword>

    <!-- Keywords will be incorporated into HTML output

         files in a meta tag but they have no effect on text or nroff

         output. If you submit your draft to the RFC Editor, the

         keywords will be used for the search engine. -->

<abstract>

<t>
  The HTTP-based Memento framework bridges the present and past Web by interlinking current resources with resources 
  that encapsulate their past. It facilitates obtaining representations of prior states of a resource, available from 
  archival resources in Web archives or version resources in content management systems, by leveraging the resource's 
  URI and a preferred datetime. To this end, the framework introduces datetime negotiation (a variation on content negotiation), 
  and new Relation Types for the HTTP "Link" header aimed at interlinking resources with their archival/version resources. 
  It also introduces various discovery mechanisms that further support bridging the present and past Web.
</t>

</abstract>

</front>

<middle>

  <!-- ********************************************************************************************************************** -->

  <!-- ********************************************************************************************************************** -->

<section title="Introduction">

<section title="Terminology">

<t>
This specification uses the terms "resource", "request", "response", "entity", "entity-body", "entity-header", "content negotiation", 
"client", "user agent", "server" as described in <xref target="RFC2616"></xref>, and it uses the terms "representation" and 
"resource state" as described in <xref target="W3C.REC-aww-20041215"></xref>.
</t>
  
<t>
  In addition, the following terms specific to the Memento framework are introduced:
</t>

<t><list style="symbols">

<t>
Original Resource: An Original Resource is a resource that exists or used to exist, and for which access 
to one of its prior states is desired.
</t>

<t>
Memento: A Memento for an Original Resource is a resource that encapsulates a prior state of the Original Resource. 
A Memento for an Original Resource as it existed at time Tj is a resource that encapsulates the state that the Original 
Resource had at time Tj. 
</t>

<t>
TimeGate: A TimeGate for an Original Resource is a resource that is capable of negotiation to allow selective, datetime-based, 
access to prior states of the Original Resource. 
</t>

<t>
TimeMap: A TimeMap for an Original Resource is a resource from which a list of URIs of Mementos of the Original Resource is available.
</t>

</list> </t>

</section>

<section title="Purpose">

<t>
The state of an Original Resource may change over time. Dereferencing its URI at any specific moment in time during its existence 
yields a representation of its then current state. Dereferencing its URI at any time past its existence no longer yields a meaningful 
representation, if any. Still, in both cases, resources may exist that encapsulate prior states of the Original Resource. 
Each such resource, named a Memento, has its own URI that, when dereferenced, returns a representation of a prior state of the Original Resource. 
Mementos may, for example, exist in Web archives, Content Management Systems, or Revision Control Systems.
</t>

<t>Examples are:</t>

  <t>Mementos for Original Resource http://www.ietf.org/ :</t>
  
  <t><list style="symbols">
    <t>http://web.archive.org/web/19970107171109/http://www.ietf.org/</t>
    <t>http://webarchive.nationalarchives.gov.uk/20080906200044/http://www.ietf.org/</t>
</list></t>

  <t>Mementos for Original Resource http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol :</t>
  
  <t><list style="symbols">
    <t>http://en.wikipedia.org/w/index.php?title=Hypertext_Transfer_Protocol&amp;oldid=366806574</t> 
    <t>http://en.wikipedia.org/w/index.php?title=Hypertext_Transfer_Protocol&amp;oldid=33912</t>
    <t>http://web.archive.org/web/20071011153017/http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol</t>
</list></t>

<t>Mementos for Original Resource http://www.w3.org/TR/webarch/ :</t>
  
  <t><list style="symbols">
    <t>http://www.w3.org/TR/2004/PR-webarch-20041105/</t>
    <t>http://www.w3.org/TR/2002/WD-webarch-20020830/</t>
    <t>http://webarchive.nationalarchives.gov.uk/20100304163140/http://www.w3.org/TR/webarch/</t>
</list></t>


  <t>
    In the abstract, Memento introduces a mechanism to access versions of Web resources that:
  </t>
  
  <t><list style="symbols">
    
    <t>Is fully distributed in the sense that resource versions may reside on multiple hosts, and that any such host 
      is likely only aware of the versions it holds;</t>
    
    <t>Uses the global notion of datetime as a resource version indicator and access key;</t>
    
    <t>Leverages the following primitives of <xref target="W3C.REC-aww-20041215">W3C.REC-aww-20041215</xref>: 
      resource, resource state, representation, content negotiation, 
      and link.</t>
    
  </list></t>
  
  <t>The core components of Memento's mechanism to access resource versions are:</t>
    
    <t>
      1. The abstract notion of the state of a resource identified by URI-R as it existed at some time Tj. 
      Note the relationship with the ability to identify a the state of a resource at some datetime Tj by means of a URI  
      as intended by the proposed Dated URI scheme <xref target="I-D.masinter-dated-uri"></xref>. 
    </t>
    
    <t>
      2. A bridge from the present to the past, consisting of:
    </t>
    
<t><list style="symbols">
      
      <t>An appropriately typed link from a resource identified by URI-R to an associated TimeGate identified by URI-G, 
        which is aware of (at least part of the) version history of the resource identified by URI-R;</t>
      
      <t>The ability to content negotiate in the datetime dimension with the TimeGate identified by URI-G, 
        as a means to obtain a representation of the state that the resource identified by URI-R had at some datetime Tj.</t>
      
    </list></t>
    
    <t>
      3. A bridge from the past to the present, consisting of an appropriately typed link from a resource identified by URI-M, 
      which encapsulates the state a resource identified 
      by URI-R had at some datetime Tj, to the resource identified by URI-R.
    </t>
  
  <t>
    <xref target="component-1.1"></xref> and <xref target="component-1.2"></xref> of this document are concerned 
    with specifying an instantiation of these abstractions for resources that are identified by HTTP(S) URIs, whereas 
    <xref target="component-2"></xref> details an approach to support batch discovery of TimeGates and TimeMaps that is based on 
    well-known URI <xref target="RFC5785"></xref> and host-meta <xref target="RFC6415"></xref>. 
  </t>
  

</section>

<section title="Notational Conventions" anchor="notation">

<t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" 
in this document are to be interpreted as described in <xref target="RFC2119"></xref>.
</t>
 
<t>
When needed for extra clarity, the following conventions are used: 
</t>
  
  <t><list style="symbols">
    
  <t>URI-R is used to denote the URI of an Original Resource.</t>  
    
    <t>URI-G is used to denote the URI of a TimeGate.</t>  
    
    <t>URI-M is used to denote the URI of a Memento.</t>  
    
    <t>URI-T is used to denote the URI of a TimeMap.</t>  
    
    <t>When scenarios are described that involve multiple Mementos, URI-M0 denotes the URI of the first Memento known 
      to the responding server, URI-Mn 
     denotes the URI of the most recent known Memento, URI-Mj denotes the URI of the selected Memento, URI-Mi denotes the URI of 
     the Memento that is temporally previous to the selected Memento, and URI-Mk denotes the URI of the Memento that is 
     temporally after the selected Memento. The respective datetimes for these Mementos are T0, Tn, Tj, Ti, and Tk; it holds that 
      T0 &lt;= Ti &lt;= Tj &lt;= Tk &lt;= Tn.</t> 
    
  </list></t>

</section>
  
</section>
  
  
  <!-- ********************************************************************************************************************** -->
  
  <!-- ********************************************************************************************************************** -->

<section title="The Memento Framework, Datetime Negotiation component: HTTP headers, HTTP Link Relation Types" anchor="component-1.1">

  <t>
    The Memento framework is concerned with Original Resources, TimeGates, Mementos, and TimeMaps that are identified by HTTP or HTTPS URIs. 
    Details are only provided for resources identified by HTTP URIs but apply similarly to those with HTTPS URIs.
  </t>

<section title="HTTP Headers">

<t>
The Memento framework operates at the level of HTTP request and response headers. It introduces two new headers 
("Accept-Datetime", "Memento-Datetime"), introduces new values for two existing headers ("Vary", "Link"), 
and uses an existing header ("Location") without modification. All these headers are described below. 
Other HTTP headers are present or absent in Memento response/request cycles as specified by <xref target="RFC2616"></xref>.
</t>

<section title="Accept-Datetime, Memento-Datetime" anchor="Accept-Memento-Datetime">

<t>
The "Accept-Datetime" request header is used by a user agent to indicate it wants to retrieve a representation of a Memento 
that encapsulates a past state of an Original Resource. To that end, the "Accept-Datetime" header is conveyed in an 
HTTP GET/HEAD request issued against a TimeGate for an Original Resource, and its value indicates the datetime of 
the desired past state of the Original Resource. 
The "Accept-Datetime" request header has no defined meaning for HTTP methods 
other than HEAD and GET.
</t>

<t>
The "Memento-Datetime" response header is used by a server to indicate that the response contains a representation of a Memento, 
and its value expresses the datetime of the state of an Original Resource that is encapsulated in that Memento. 
The URI of that Original Resource is provided in the response, as the Target IRI (see <xref target="RFC5988"></xref>) 
  of a link provided in the HTTP "Link" header that has a 
  Relation Type of "original" (see <xref target="Link-Header-Relation-Types"></xref>).
</t>

<t>
    The presence of a "Memento-Datetime" header and associated value for a given resource constitutes a promise that the resource 
    is stable and that its state will no longer change. This means that, in terms of the Ontology for Relating Generic and Specific Information Resources
  (see <xref target="W3C.gen-ont-20090420">W3C.gen-ont-20090420</xref>), a Memento is a FixedResource.</t>
  
  <t>As a consequence, "Memento-Datetime" headers associated with a Memento MUST be "sticky" in the following ways:</t>  
  
  <t><list style="symbols">
    
    <t>The server that originally assigns the "Memento-Datetime" header and value 
      MUST retain that header in all responses to HTTP HEAD/GET requests (with or without "Accept-Datetime" header) 
      that occur against the Memento after 
      the time of the original assignment of the header, and it MUST NOT change its associated value.</t>   
    <t>Applications that mirror Mementos at a different URI MUST NOT change 
      the "Memento-Datetime" header and value of those Mementos unless mirroring involves a meaningful state change.
      This allows, for example, duplicating a Web archive at a new location while preserving the 
      value of the "Memento-Datetime" header of the archived resources. In this example, the "Last-Modified" header 
      will be updated to reflect the time of mirroring at the new URI, whereas the value for "Memento-Datetime" 
      will be sticky.</t>      
    
  </list></t>
  

  
<section title="Values for Accept-Datetime" anchor="accept-datetime">

<t>Values for the "Accept-Datetime" header consist of a MANDATORY datetime expressed according to the 
    <xref target="RFC1123"></xref> format, which is formalized by the rfc1123-date construction 
    rule of the BNF in <xref target="datetime-BNF"></xref>. The datetime MUST be represented 
  in Greenwich Mean Time (GMT).
</t> 
  
  <t>
    Example of an "Accept-Datetime" request header:
  </t>
  
  <figure>
    <artwork align="left"><![CDATA[ 
Accept-Datetime: Thu, 31 May 2007 20:35:00 GMT
]]></artwork>
  </figure>
  
  <t>
  The user agent uses the MANDATORY datetime value to convey its preferred datetime for a Memento.
  </t>
  
  

  
  <figure align="center" anchor="datetime-BNF" title="BNF for the datetime format">
    
    <artwork align="left"><![CDATA[

accept-dt-value = rfc1123-date *SP
rfc1123-date = wkday "," SP date1 SP time SP "GMT"
date1        = 2DIGIT SP month SP 4DIGIT 
                  ; day month year (e.g., 20 Mar 1957)
time         = 2DIGIT ":" 2DIGIT ":" 2DIGIT 
                  ; 00:00:00 - 23:59:59 (e.g., 14:33:22)
wkday        = "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | 
               "Sun" 
month        = "Jan" | "Feb" | "Mar" | "Apr" | "May" | "Jun" | 
               "Jul" | "Aug" | "Sep" | "Oct" | "Nov" | "Dec"

]]></artwork>
    
  </figure>

</section>
  
  <section title="Values for Memento-Datetime" anchor="memento-datetime">
    
    <t>
      Values for the "Memento-Datetime" headers MUST be datetimes expressed according 
      to the rfc1123-date construction rule of the BNF in <xref target="datetime-BNF"></xref>; 
      they MUST be represented in Greenwich Mean Time (GMT).
    </t>
    
    <t>
      An example "Memento-Datetime" response header:
    </t>
    
<figure>
      <artwork align="left"><![CDATA[ 
Memento-Datetime: Wed, 30 May 2007 18:47:52 GMT
]]></artwork>
</figure>
    
  </section>
    
</section>

<section title="Vary">

<t>
The "Vary" response header is used in responses to indicate the dimensions in 
  which content negotiation was successfully applied. This header is used in the Memento framework to indicate both whether datetime  
  negotiation was applied or is supported by the responding server. 
</t>

<t>
For example, this use of the "Vary" header indicates that datetime is the only dimension in which negotiation was applied:
</t>

<figure>
<artwork align="left"><![CDATA[
Vary: negotiate, accept-datetime
]]></artwork>
</figure>

<t>
The use of the "Vary" header in this example shows that both datetime negotiation, and media type content negotiation were applied:
</t>

<figure>
<artwork align="left"><![CDATA[
Vary: negotiate, accept-datetime, accept
]]></artwork>
</figure>

</section>

<section title="Location">

<t>
The "Location" header is used as defined in <xref target="RFC2616"></xref>.  
  Examples are given in <xref target="component-1.2"></xref> below.
</t>

</section>
  
  <section title="Link">
    
    <t>
      The "Link" response header is specified in <xref target="RFC5988"></xref>. 
      The Memento framework introduces new Relation Types to convey typed links among Original Resources, TimeGates, Mementos, and TimeMaps.
      Already existing Relation Types, among others, aimed at supporting navigation among a series of ordered resources may also be used 
      in the Memento framework. 
      This is detailed in <xref target="Link-Header-Relation-Types">Link Header Relation Types</xref>, below.
    </t>
    
  </section>

</section>

<section title="Link Header Relation Types" anchor="Link-Header-Relation-Types">

<t>
The "Link" header specified in <xref target="RFC5988"></xref> is semantically equivalent 
  to the "&lt;LINK&gt;" element in HTML, 
  as well as the "atom:link" feed-level element in Atom <xref target="RFC4287"></xref>. 
  By default, the origin of a link expressed by an entry in a "Link" header 
  (named Context IRI in <xref target="RFC5988"></xref>) 
  is the IRI of the requested resource. This default can be overwritten using the "anchor" attribute in the entry.
</t>

<section title="Memento Framework Relation Types" anchor="memento-rels">

<t>
The Relation Types used in the Memento framework are listed in the remainder of this section, and their use is summarized in 
  the below table. <xref target="AppendixFlow"></xref> shows a Memento request/response cycle 
  that uses all the Relation Types that are introduced here.</t>
    
    <texttable anchor="Relation-Type-Table" title="The use of Relation Types">  
      <ttcol align="center">Relation Type</ttcol>    
      <ttcol align="center">Original Resource</ttcol>    
      <ttcol align="center">TimeGate</ttcol>     
      <ttcol align="center">Memento</ttcol>     
      <c>original</c>     
      <c>NA, except see <xref target="HTTP_OriginalResource_server_memento"></xref></c>     
      <c>REQUIRED, 1</c>     
      <c>REQUIRED, 1</c>     
      <c>timegate</c>     
      <c>RECOMMENDED, 0 or more</c>     
      <c>REQUIRED, 1 in case of <xref target="HTTP_TimeGate_redirect"></xref></c>    
      <c>RECOMMENDED, 0 or more</c>     
      <c>timemap</c>    
      <c>NA</c>    
      <c>RECOMMENDED, 0 or more</c>    
      <c>RECOMMENDED, 0 or more</c>    
      <c>memento</c>     
      <c>NA, except see <xref target="HTTP_OriginalResource_server_memento"></xref></c>    
      <c>REQUIRED, 1 or more</c>     
      <c>REQUIRED, 1 or more</c>     
    </texttable>
    
  
  <section title="Relation Type &quot;original&quot;">
    
    <t>
      "original" -- A "Link" header entry with a Relation Type of "original" is used to point from a TimeGate or 
      a Memento to their associated Original Resource. 
      In both cases, an entry with the "original" Relation Type MUST occur exactly once in a "Link" header. 
      Details for the entry are as follows:
    </t>
    
    <t><list style="symbols">
      
      <t>Context IRI: URI-G, URI-M</t>
      
      <t>Target IRI: URI-R</t>
      
      <t>Relation Type: "original"</t>
      
      <t>Use: REQUIRED</t>
      
      <t>Cardinality: 1</t>
      
    </list></t>
    
  </section>

<section title="Relation Type &quot;timegate&quot;">

<t>
"timegate" -- A "Link" header entry with a Relation Type of "timegate" is used to point both from an Original Resource  
or a Memento to a TimeGate for the Original Resource. In both cases, the use of an entry with the "timegate" 
Relation Type is RECOMMENDED. Since more than one TimeGate can exist for any Original Resource, multiple entries with a "timegate" 
Relation Type MAY occur, each with a distinct Target IRI. Since a TimeGate has no mime type, the "type" attribute MUST NOT be used 
on Links with a "timegate" Relation Type.
Details for the entry are as follows:
</t>

<t><list style="symbols">

<t>Context IRI: URI-R or URI-Mj</t>

<t>Target IRI: URI-G</t>

<t>Relation Type: "timegate"</t>

<t>Use: RECOMMENDED</t>

<t>Cardinality: 0 or more</t>

</list></t>
  
  <t>
    In the special case (see <xref target="HTTP_TimeGate_redirect"></xref>) where a TimeGate 
    redirects to another TimeGate for the Original Resource, 
  a "Link" header entry with a Relation Type of "timegate" MUST be used to point from the former to the latter.   
  </t>

</section>

<section title="Relation Type &quot;timemap&quot;">

<t>
"timemap" -- A "Link" header entry with a Relation Type of "timemap" is used to point from both a TimeGate 
or a Memento to a TimeMap resource from which a list of Mementos known to the responding server is available. 
Use of an entry with the "timemap" Relation Type is RECOMMENDED, and, since multiple serializations of a TimeMap are possible,
multiple entries with a "timemap" Relation Type MAY occur, each with a distinct Target IRI, and each with a MANDATORY 
"type" attribute to convey the mime type of the TimeMap serialization. Details for the entry are as follows:
</t>

<t><list style="symbols">

<t>Context IRI: URI-G or URI-Mi</t>

<t>Target IRI: URI-T</t>

<t>Relation Type: "timemap"</t>
  
<t>Target Attribute: "type"</t>

<t>Use: RECOMMENDED</t>

<t>Cardinality: 0 or more</t>

</list></t>
  
  <t>Further details about TimeMap serializations are provided in <xref target="timemap"></xref>.</t>
  
</section>

<section anchor="memento-rel" title="Relation Type &quot;memento&quot;">

<t>
"memento" -- A "Link" header entry with a Relation Type of "memento" is used to point from  
both a TimeGate and a Memento to various Mementos for an Original Resource. 
This link MUST include a "datetime" attribute with a value that matches the "Memento-Datetime" 
of the Memento that is the target of the link; that is, 
the value of the "Memento-Datetime" header that is returned when the URI of the linked Memento is dereferenced. 
The value for the "datetime" attribute MUST be a datetime expressed according 
to the rfc1123-date construction rule of the BNF in <xref target="datetime-BNF"></xref> and it MUST be represented 
  in Greenwich Mean Time (GMT). The link SHOULD also 
include a "type" attribute to convey the mime type of the Memento that is the target of the link.
Use of entries with the "memento" Relation Type is REQUIRED and it MUST be as follows:
</t>
  
  <t>For all responses to HTTP HEAD/GET requests issued against a TimeGate or a Memento in which 
    a Memento is selected or served by the responding server:</t>
  <t><list style="symbols">
    <t>One "memento" link MUST be included that has as Target IRI the URI of the Memento that was selected or served;</t>
    <t>One "memento" link MUST be included that has as Target IRI the URI of the temporally first Memento known to the responding server;</t>
    <t>One "memento" link MUST be included that has as Target IRI the URI of the temporally most recent Memento known to the responding server.</t>
    <t>One "memento" link SHOULD be included that has as Target IRI the URI of the Memento that is previous to the selected Memento in the temporal 
      series of all Mementos (sorted by ascending "Memento-Datetime" values) known to the server;</t>
    <t>One "memento" link SHOULD be included that has as Target IRI the URI the Memento that is next to the selected Memento in the temporal series of all Mementos 
      (sorted by ascending "Memento-Datetime" values) known to the server.</t>
    <t>Other "memento" links MAY only be included if both the aforementioned previous and next links are provided. 
      Each of these OPTIONAL 
      "memento" links MUST have as Target IRI the URI of a Memento other than the ones listed above.</t>
  </list></t>

  <t>For all responses to HTTP HEAD/GET requests issued against an existing TimeGate or Memento in which no Memento is selected 
    or served by the responding server:</t> 
  <t><list style="symbols">
  <t>One "memento" link MUST be included that has as Target IRI the URI of the temporally first Memento known to the responding server;</t>
  <t>One "memento" link MUST be included that has as Target IRI the URI of the temporally most recent Memento known to the responding server.</t>
   <t>Other "memento" links MAY be included, and each of these OPTIONAL links MUST have as Target IRI the URI of a Memento other 
      than the two listed above.</t>
  </list></t>
   
  <t>Note that the Target IRI of some of these links may coincide. For example, if the selected Memento actually is the first 
    Memento known to the server, only three distinct "memento" links may result. The value for the "datetime" attribute of these links would 
    be the datetimes of the first (equal to selected), next, and most recent Memento known to the responding server.</t>
  
  <t>The summary is as follows:</t>
  
  <t><list style="symbols">

<t>Context IRI: URI-G, URI-Mj</t>

<t>Target IRI: URI-M</t>

<t>Relation Type: "memento"</t>

<t>Target Attributes: "datetime"</t>

<t>Use: REQUIRED</t>

<t>Cardinality: 1 or more</t>

</list></t>

</section>
  
  </section>
  
  <section anchor="other-rels" title="Other Relation Types">
    
    <t>Web Linking <xref target="RFC5988"></xref> allows for the inclusion of links with different Relation Types but 
      the same Target IRI, and hence the Relation Types introduced by the Memento framework MAY be combined with others 
      as deemed necessary. As the "memento" Relation Type focuses on conveying the datetime of a linked Memento, Relation Types 
      that allow navigating among the temporally ordered series of Mementos known to a server are of particular 
      importance. With this regard, the Relation Types listed in the below table SHOULD be considered for 
      combination with the "memento" Relation Type. A distinction is made between responding servers that 
      can be categorized as systems that are the focus of <xref target="RFC5829"></xref> 
      (such as version control systems) 
      and others that can not (such as 
      Web archives). Note that, in terms of <xref target="RFC5829"></xref>, the last Memento (URI-Mn) is 
      the version prior to the latest (i.e. current) version.</t>
       
    <texttable anchor="other-rel-types" title="The use of Relation Types">
      
      <ttcol align="center">Memento Type</ttcol>
      
      <ttcol align="center">RFC5829 system</ttcol>
      
      <ttcol align="center">non RFC5829 system</ttcol>
      
      <c>First Memento (URI-M0)</c>
      
      <c>first</c>
      
      <c>first</c>
      
      
      <c>Last Memento (URI-Mn)</c>
      
      <c>last</c>
      
      <c>last</c>
      
      <c>Selected Memento (URI-Mj)</c>
      
      <c>NA</c>
      
      <c>NA</c>
      
      <c>Memento prior to selected Memento (URI-Mi)</c>
      
      <c>predecessor-version</c>
      
      <c>prev</c>
      

      
      <c>Memento next to selected Memento (URI-Mk)</c>
      
      <c>successor-version</c>
      
      <c>next</c>

      
    </texttable>
    
    </section>
  
</section>
  
</section>

<!-- ********************************************************************************************************************** -->

<!-- ********************************************************************************************************************** -->

  <section title="The Memento Framework, Datetime Negotiation component: HTTP Interactions" anchor="component-1.2">

  <t>This section describes the HTTP interactions of the Memento framework for a variety 
    of scenarios. First, <xref target="intro-flow"></xref> provides a schematic overview of a successful request/response chain that 
    involves datetime negotiation. Dashed lines depict HTTP transactions between user agent and server. <xref target="AppendixFlow"></xref> 
    shows these HTTP interactions in detail for the case where the Original Resource resides on one server, 
    whereas both the TimeGate and the Mementos reside on another. Scenarios also exist in which all these resources 
    are on the same server (for example, Content Management Systems) or on different servers (for example, an aggregator of TimeGates). 
    Note that, in Step 2 and Step 6, the HTTP status code of the response is shown as 
    "200 OK", but a series of "206 Partial Content" responses could be substituted without loss of generality.
  </t>
           
    <!--
      
      xxxxxxxxxxxxxxxxxxxxxxxx max width for pics xxxxxxxxxxxxxxxxxxxxxxxxx
      
    -->

    <figure align="center" anchor="intro-flow" title="Typical Memento request/response chain">
      
      <artwork align="left"><![CDATA[
1: UA --- HTTP GET/HEAD; Accept-Datetime: Tj ---------------> URI-R
2: UA <-- HTTP 200; Link: URI-G ----------------------------- URI-R
3: UA --- HTTP GET/HEAD; Accept-Datetime: Tj ---------------> URI-G
4: UA <-- HTTP 302; Location: URI-Mj; Vary; Link:
      URI-R,URI-T,URI-M0,URI-Mn,URI-Mi,URI-Mj,URI-Mk -------- URI-G
5: UA --- HTTP GET URI-Mj; Accept-Datetime: Tj -------------> URI-Mj
6: UA <-- HTTP 200; Memento-Datetime: Tj; Link:  
      URI-R,URI-T,URI-G,URI-M0,URI-Mn,URI-Mi,URI-Mj,URI-Mk -- URI-Mj
]]></artwork>
      
    </figure>   
    
    <t><list style="symbols">
      
      <t>
        Step 1: In order to determine what the URI is of a TimeGate for an Original Resource, 
        the user agent issues an HTTP HEAD/GET request against the URI of the Original Resource (URI-R).
      </t>
      
      <t>
        Step 2: The entity-header of the response from URI-R includes an HTTP "Link" header 
        with a Relation Type of "timegate" pointing at a TimeGate (URI-G) for the Original Resource.
      </t>
      
      <t>
        Step 3: The user agent starts the datetime negotiation process with the TimeGate by issuing 
        an HTTP GET request against its URI-G thereby including an "Accept-Datetime" 
        HTTP header with a value of the datetime of the desired prior state of the Original Resource.
      </t>
      
      <t>
        Step 4: The entity-header of the response from URI-G includes a "Location" header pointing at 
        the URI of a Memento (URI-Mj) for the Original Resource. 
        In addition, the entity-header contains an HTTP "Link" header with a Relation Type of "original" 
        pointing at the Original Resource, and an HTTP "Link" header with a Relation Type 
        of "timemap" pointing at a TimeMap (URI-T). Also HTTP Links pointing at various Mementos are provided using the 
        "memento" Relation Type, as specified in <xref target="memento-rel"></xref>.
      </t>
      
      <t>
        Step 5: The user agent issues an HTTP GET request against the URI-Mj of a Memento, obtained in Step 4.
      </t>
      
      <t>
        Step 6: The entity-header of the response from URI-Mj includes a "Memento-Datetime" HTTP header with a 
        value of the datetime of the Memento.  
        It also contains an HTTP "Link" header with a Relation Type of "original" pointing at the Original Resource, 
        with a Relation Type of "timegate" pointing at a TimeGate 
        associated with the Original Resource, and with a Relation Type of "timemap" pointing at a TimeMap. 
        The state that is expressed by the representation provided in the response is the state the Original 
        Resource had at the datetime expressed in the "Memento-Datetime" header. This response also includes 
        HTTP Links with a "memento" Relation Type pointing at various Mementos, as specified in <xref target="memento-rel"></xref>.
      </t>
      
    </list></t>
   
    <t>
      The following sections detail the specifics of HTTP interactions with Original Resources, TimeGates, Mementos, 
      and TimeMaps under various conditions. 
    </t>

    <section anchor="HTTP_OriginalResource" title="Interactions with an Original Resource">

      <t>
      This section details HTTP GET/HEAD requests targeted at an Original Resource (URI-R). 
      </t>   

      <section anchor="HTTP_OriginalResource_client" title="Step 1: User Agent Requests an Original Resource">

      <t>
        In order to try and discover a TimeGate for the Original Resource, the user agent SHOULD issue an HTTP HEAD or GET request 
        against the Original Resource's URI.  Use of the "Accept-Datetime" header in the HTTP HEAD/GET request is OPTIONAL.
      </t>

      <t>
        <xref target="a200-step1-http"></xref> shows the use of HTTP HEAD indicating
        the user agent is not interested in retrieving a representation of the Original Resource, 
        but only in determining a TimeGate for it. 
        It also shows the use of the "Accept-Datetime" header
        anticipating that the user agent will set it for the entire duration of a
        Memento request/response cycle.
      </t>

        <figure title="User Agent Requests Original Resource" align="center" anchor="a200-step1-http">       
          <artwork align="left"><![CDATA[
HEAD / HTTP/1.1
Host: a.example.org
Accept-Datetime: Tue, 11 Sep 2001 20:35:00 GMT
Connection: close
]]></artwork>         
        </figure>

      </section>

      <section anchor="HTTP_OriginalResource_server" title="Step 2: Server Responds to a Request for an Original Resource">

        <t>        
          The response of the Original Resource's server
          to the user agent's HTTP HEAD/GET request of Step 1, for the case where the Original Resource exists,  
          is as it would be in a regular HTTP request/response cycle, but in addition MAY include a HTTP "Link" header 
          with a Relation Type of "timegate" that conveys the URI of the Original Resource's TimeGate as the Target IRI of the Link.
          Multiple HTTP Links with a relation type of "timegate" MAY be provided to accommodate situations in which the server is aware of 
          multiple TimeGates for an Original Resource. The actual Target IRI provided in the "timegate" 
          Link may depend on several factors including 
          the datetime provided in the "Accept-Datetime" header, and the IP address of the user agent. 
          A response for this case is illustrated in <xref target="a200-step2-http"></xref>.
        </t>

        <figure title="Server of Original Resource Responds" align="center" anchor="a200-step2-http">  
          <artwork align="left"><![CDATA[
HTTP/1.1 200 OK
Date: Thu, 21 Jan 2010 00:02:12 GMT
Server: Apache
Link: <http://arxiv.example.net/timegate/http://a.example.org>
   ; rel="timegate"
Content-Length: 255
Connection: close
Content-Type: text/html; charset=iso-8859-1
]]></artwork>
        </figure>

        <t>
          Servers that actively maintain archives of their resources SHOULD include the "timegate" HTTP "Link" header
          because this link is an important way for a user agent to discover TimeGates for those resources. 
          This includes servers such as Content Management Systems, Control Version Systems, 
          and Web servers with associated transactional archives <xref target="Fitch">Fitch</xref>. 
          Servers that do not actively maintain archives of their resources MAY include the "timegate" HTTP "Link" header 
          as a way to convey a preference for TimeGates for their resources exposed by a third party archive. 
          This includes servers that rely on Web archives such as the Internet Archive to archive their resources.
        </t>
        
        <t>
          The server of the Original Resource MUST treat requests with and without an "Accept-Datetime" header in the same way:
        </t>    

<t><list style="symbols">
  
  <t>The response MUST either always or never include a HTTP "Link" header with an entry that has a "timegate" Relation Type and 
  the URI of a TimeGate as the Target IRI.</t>
  
  <t>The entity-body of the response MUST be the same, for user agent requests with or without a "Accept-Datetime" header.</t>
  
</list></t>

        <section title="Original Resource is an Appropriate Memento" anchor="HTTP_OriginalResource_server_memento">
          
          <t>The "Memento-Datetime" header MAY be applied to an Original Resource directly 
            to indicate it is a FixedResource (see <xref target="W3C.gen-ont-20090420">W3C.gen-ont-20090420</xref>), 
            meaning that the state of the Original Resource has not changed since 
            the datetime conveyed in the "Memento-Datetime" header, and as a promise that it will not change 
            anymore beyond it. This may occur, for example, for certain stable media resources 
            on news sites. 
            In case the user agent's preferred datetime is equal to or more recent than the datetime conveyed as the value of 
            "Memento-Datetime" in the server's response in Step 2, the user agent SHOULD conclude it has located an appropriate Memento, and it 
            SHOULD NOT continue to Step 3.</t>
          
          <t><xref target="memento-response-URI-R1"></xref> illustrates such a response to a request 
            for the resource with URI http://a.example.org/pic that has been stable since it was created. Note the use of both 
            the "memento" and "original" Relation Types for links that have as Target IRI the URI of the Original Resource.
          </t>
          
          <figure align="center" anchor="memento-response-URI-R1" title="Response to a request for an Original Resource that was created as a FixedResource">
            <artwork align="left"><![CDATA[
HTTP/1.1 200 OK
Date: Thu, 21 Jan 2010 00:02:12 GMT
Server: Apache
Link: 
 <http://a.example.org/pic> 
  ; rel="original memento" 
  ; datetime="Fri, 20 Mar 2009 11:00:00 GMT"
Memento-Datetime: Fri, 20 Mar 2009 11:00:00 GMT
Content-Length: 255
Connection: close
Content-Type: text/html; charset=iso-8909-1

]]></artwork>
          </figure>
         
 <t>Cases may also exist in which a resource becomes stable at a certain point in its existence, but changed previously. 
 In such cases, the Original Resource may know about a TimeGate that is aware of its prior history and hence MAY also include 
 a link with a "timegate" Relation Type. This is illustrated in <xref target="memento-response-URI-R2"></xref>, where 
   the "memento" and "original" Relation Types are used as in <xref target="memento-response-URI-R1"></xref>, and 
   the existence of a TimeGate to negotiate for Mementos with datetimes prior to 
   Fri, 20 Mar 2009 11:00:00 GMT is indicated.</t>         
         
          <figure align="center" anchor="memento-response-URI-R2" title="Response to a request for an Original Resource that became a FixedResource">
            <artwork align="left"><![CDATA[
HTTP/1.1 200 OK
Date: Thu, 21 Jan 2010 00:02:12 GMT
Server: Apache
Link: 
 <http://a.example.org/pic> 
  ; rel="original memento" 
  ; datetime="Fri, 20 Mar 2009 11:00:00 GMT",
 <http://arxiv.example.net/timegate/http://a.example.org/pic> 
  ; rel="timegate"
Memento-Datetime: Fri, 20 Mar 2009 11:00:00 GMT
Content-Length: 255
Connection: close
Content-Type: text/html; charset=iso-8909-1
]]></artwork>
          </figure>
          
        </section> 

<section title="Server Exists and Original Resource Used to Exist" anchor="HTTP_OriginalResource_server_404">

<t>
Servers SHOULD also provide a "timegate" HTTP "Link" header in responses
to requests for an Original Resource that the server knows used to exist, but no longer does.
This allows the use of an Original Resource's URI as an
entry point to representations of its prior states even if the
resource itself no longer exists. A server's response for this case is illustrated in <xref target="a404-response-URI-R"></xref>.
</t>

<figure align="center" anchor="a404-response-URI-R" title="Response to a request for an Original Resource that not longer exists">
<artwork align="left"><![CDATA[
HTTP/1.1 404 Not Found
Date: Thu, 21 Jan 2010 00:02:12 GMT
Server: Apache
Link: 
 <http://arxiv.example.net/timegate/http://a.example.org/gone> 
  ; rel="timegate"
Content-Length: 255
Connection: close
Content-Type: text/html; charset=iso-8909-1

]]></artwork>
</figure>

  <t>In case the server is not aware of the prior existence of the Original Resource, its response SHOULD NOT include a "timegate" HTTP Link.
    <xref target="HTTP_OriginalResource_server_xxx"></xref> details what the user agent's behavior should be in such cases.</t>

</section>
        
    
        
        <section title="Missing or Inadequate &quot;timegate&quot; Link in Original Server's Response" anchor="HTTP_OriginalResource_server_xxx">
          
          <t>
            A user agent MAY ignore the TimeGate returned in Step 2. However, when engaging in a Memento 
            request/response cycle, a user agent SHOULD NOT proceed immediately to Step 3 by using a TimeGate of its own preference but rather 
            SHOULD always start the cycle by issuing an HTTP GET/HEAD against the Original Resource 
            (Step 1, <xref target="a200-step1-http"></xref>) as it is an important way 
            to learn about dedicated or preferred TimeGates for the Original Resource. Also, cases exist in which the response 
            in Step 2 will not provide a "timegate" link, including:</t>
          
          <t><list style="symbols">
            <t>The Original Resource's server does not support the Memento framework;</t>
            <t>The Original Resource no longer exists and the responding server is not aware of its prior existence;</t>
            <t>The server that hosted the Original Resource no longer exists;</t>       
          </list></t>
          
          <t>In all these cases, the user agent SHOULD attempt to determine an appropriate TimeGate for the Original Resource, 
            either automatically or interactively supported by the user. The discovery mechanisms described in 
            <xref target="component-2"></xref> can support the user agent with this regard.</t>
          
        </section>      
      </section>     
      </section>

<section anchor="HTTP_TimeGate" title="Interactions with a TimeGate">

<t>This section details HTTP GET/HEAD requests targeted at a TimeGate (URI-G).</t>

      <section anchor="HTTP_TimeGate_client" title="Step 3: User Agent Negotiates with a TimeGate">

<t>
In order to negotiate with a TimeGate, the user agent MUST issue a HTTP HEAD or GET against its URI, 
its request MUST include the "Accept-Datetime" header to express its datetime preference, 
and the use of that header MUST be as described in 
  <xref target="accept-datetime"></xref>. 
The URI of the TimeGate may have been provided as the Target IRI of a "timegate" HTTP "Link" header in the response 
  from the Original Resource (Step 2, <xref target="a200-step2-http"></xref>), or may have resulted from another discovery 
  mechanism (see <xref target="component-2"></xref>) or user interaction.
  Such a request is illustrated in <xref target="a200-step3-http"></xref>. 
</t>
   

<figure title="User agent negotiates with TimeGate" align="center" anchor="a200-step3-http">        
          <artwork align="left"><![CDATA[
GET /timegate/http://a.example.org HTTP/1.1
Host: arxiv.example.net
Accept-Datetime: Tue, 11 Sep 2001 20:35:00 GMT
Connection: close
]]></artwork>       
        </figure> 
              
  </section>
  
      <section anchor="HTTP_TimeGate_server" title="Step 4: Server Responds to Negotiation with TimeGate">

<t>
  In order to respond to a datetime negotiation request (Step 3, <xref target="HTTP_TimeGate_client"></xref>), 
  the server uses an internal algorithm to select the Memento that best meets the user agent's 
  datetime preference, and redirects to it. The exact nature of the selection algorithm is at the server's discretion
  but SHOULD be consistent. A variety of approaches can be used including selecting the Memento 
  that is nearest in time (either past or future) or nearest in the past relative to the requested datetime.
  The commons scenario for datetime negotiation with a TimeGate is 
  described in <xref target="HTTP_TimeGate_server_OK"></xref> but special cases exist, 
  and they are addressed in <xref target="HTTP_TimeGate_server_300"></xref> through 
  <xref target="TG_other"></xref>.
  </t>
  
<section title="Successful Scenario" anchor="HTTP_TimeGate_server_OK">
      
  <t>
    In cases where the TimeGate exists, and 
    the datetime provided in the user agent's "Accept-Datetime" header can be parsed, 
    the server selects a Memento based 
    on the user agent's datetime preference. The response MUST have a "302 Found" HTTP status code, 
    and the "Location" header MUST be used to convey the URI of the selected Memento.  
    The "Vary" header MUST be provided and it MUST include the "negotiate" and "accept-datetime" values
    to indicate that datetime negotiation has taken place. The "Link" header MUST be provided and contain links with Relation Types 
      subject to the considerations described in <xref target="Link-Header-Relation-Types"></xref>. The response MUST NOT contain a 
    "Memento-Datetime" header.
    Such a response is illustrated in <xref target="a200-step4-http"></xref>. 
  </t>
  
  <figure title="Server of TimeGate responds" align="center" anchor="a200-step4-http">  
    <artwork align="left"><![CDATA[
HTTP/1.1 302 Found
Date: Thu, 21 Jan 2010 00:06:50 GMT
Server: Apache
Vary: negotiate, accept-datetime
Location: 
 http://arxiv.example.net/web/20010911203610/http://a.example.org
Link: <http://a.example.org>; rel="original",
 <http://arxiv.example.net/timemap/http://a.example.org>
   ; rel="timemap"; type="application/link-format",
 <http://arxiv.example.net/web/20000915112826/http://a.example.org>
   ; rel="first memento"; datetime="Tue, 15 Sep 2000 11:28:26 GMT",
 <http://arxiv.example.net/web/20080708093433/http://a.example.org>
   ; rel="last memento"; datetime="Tue, 08 Jul 2008 09:34:33 GMT",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org>
   ; rel="memento"; datetime="Tue, 11 Sep 2001 20:36:10 GMT",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org>
   ; rel="prev memento"; datetime="Tue, 11 Sep 2001 20:30:51 GMT",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org> 
   ; rel="next memento"; datetime="Tue, 11 Sep 2001 20:47:33 GMT"
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Connection: close
]]></artwork>
  </figure>    
  
  <t>
    If a user agent's "Accept-Datetime" header conveys a datetime that is 
    either earlier than the datetime of the first Memento or later than the datetime of the most recent Memento 
    known to the server, the server's response is as just described yet entails the  
    selection of the first or most recent Memento, respectively.
  </t>
  
  <t>
    This is illustrated in <xref target="a406-http-a"></xref> that shows 
    the response from a TimeGate exposed by a MediaWiki server to a request by a user agent that 
    has an "Accept-Datetime: Mon, 31 May 1999 00:00:00 GMT" header. Note that a link is provided with a "successor-version" 
    Relation Type but not with a "predecessor-version" Relation Type.
  </t>
  
  <figure align="center" anchor="a406-http-a" title="A TimeGate's response to a request for a Memento with a datetime earlier than that of the first Memento">             
    <artwork align="left"><![CDATA[
HTTP/1.1 302 Found
Server: Apache
Content-Length: 709
Content-Type: text/html; charset=utf-8
Date: Thu, 21 Jan 2010 00:09:40 GMT
Location: 
 http://a.example.org/w/index.php?title=Clock&oldid=1493688
Vary: negotiate, accept-datetime
Link: <http://a.example.org/w/Clock>; rel="original",
 <http://a.example.org/Special:TimeMap/http://a.example.org/w/Clock>
   ; rel="timemap",
 <http://a.example.org/w/index.php?title=Clock&oldid=1493688>
   ; rel="first memento"; datetime="Sun, 28 Sep 2003 01:42:00 GMT", 
    <http://a.example.org/w/index.php?title=Clock&oldid=1493854>
   ; rel="successor-version memento"
   ; datetime="Tue, 30 Sep 2003 14:28:00 GMT", 
 <http://a.example.org/w/index.php?title=Clock&oldid=337446696>
   ; rel="last memento"; datetime="Tue, 12 Jan 2010 19:55:00 GMT"
Connection: close
]]></artwork>         
  </figure>
  
</section>
        
        <section title="Multiple Matching Mementos" anchor="HTTP_TimeGate_server_300">
          
          <t>
            Because the finest datetime granularity expressible using the <xref target="RFC1123"></xref> format used in HTTP 
            is seconds level, 
            cases may occur in which a TimeGate server is aware of multiple Mementos that meet the user agent's datetime preference. 
            This may occur in Content Management Systems with very high update rates.  
            The response in this case MUST be handled as in <xref target="HTTP_TimeGate_server_OK"></xref>, with the selection of one of the 
            matching Mementos. 
          </t> 
          
          <t>
            As an example, <xref target="a300-http"></xref> shows a hypothetical response from a 
            TimeGate on a MediaWiki server to a request for a Memento for the Original Resource http://a.example.org/w/Clock  
            for which two Mementos exist for the user agent's preferred datetime.
          </t>
          
          <figure align="center" anchor="a300-http" title="A TimeGate's response to a request that has multiple Mementos with a matching datetime">
            
            <artwork align="left"><![CDATA[
HTTP/1.1 302 Found
Server: Apache
Content-Length: 705
Content-Type: text/html; charset=utf-8
Date: Thu, 21 Jan 2010 00:09:40 GMT
Vary: negotiate, accept-datetime
Location: 
 http://a.example.org/w/index.php?title=Clock&oldid=322586071
Link: <http://a.example.org/w/Clock>; rel="original",
 <http://a.example.org/Special:TimeMap/http://a.example.org/w/Clock>
   ; rel="timemap";type="application/link-format",
 <http://a.example.org/w/index.php?title=Clock&oldid=1493688>
   ; rel="first memento"; datetime="Sun, 28 Sep 2003 01:42:00 GMT",
 <http://a.example.org/w/index.php?title=Clock&oldid=337446696>
   ; rel="last memento"; datetime="Tue, 12 Jan 2010 19:55:00 GMT",
 <http://a.example.org/w/index.php?title=Clock&oldid=322586071>
   ; rel="memento"; datetime="Sun, 31 May 2009 15:43:00 GMT",
 <http://a.example.org/w/index.php?title=Clock&oldid=326164283> 
   ; rel="memento successor-version"
   ; datetime="Sun, 31 May 2009 15:43:00 GMT"
 <http://a.example.org/w/index.php?title=Clock&oldid=326164283> 
   ; rel="memento predecessor-version"
   ; datetime="Sun, 31 May 2009 15:41:24 GMT"
Connection: close
]]></artwork>
          </figure>
        </section>
  
        <section title="TimeGate Redirects to another TimeGate" anchor="HTTP_TimeGate_redirect">
          
          <t>
            Cases may exist in which a TimeGate's response entails a redirects to another TimeGate, 
            for example, because the responding TimeGate is aware that the other TimeGate is able to more precisely respond to a client's 
            datetime preference. 
            In such cases, the TimeGate's response MUST have a "302 Found" HTTP status code, 
            and the "Location" header MUST be used to convey the URI of the other TimeGate.  
            The "Vary" header MUST be provided and it MUST include the "negotiate" and "accept-datetime" values
            to indicate that, although datetime negotiation has not taken place, the responding TimeGate is capable of it. 
            The "Link" header MUST be provided and contain links with Relation Types 
            subject to the considerations described in <xref target="Link-Header-Relation-Types"></xref>. 
            Specifically, the use of links with a "memento" Relation Type MUST follow the rules  
            for the case where no Memento is selected by the responding server (<xref target="memento-rel"></xref>). Also,  
            a link with a "timegate" Relation Type MUST be provided that has as Target IRI the URI of the TimeGate to which 
            the current TimeGate is redirecting the client. The response MUST NOT contain a 
            "Memento-Datetime" header.
          </t>
          
          <t>
            A response in which the client is redirected by TimeGate http://arxiv.example.net/timegate/http://a.example.org to 
            TimeGate http://otherarxiv.example.com/timegate/http://a.example.org for the Original Resource http://a.example.org 
            is illustrated in <xref target="step4-tg-redirect"></xref>. Note the URI of the latter TimeGate 
            in both the "Location" and "Link" header, in the latter case as the Target IRI of a "timegate" link. 
            Note also that the "memento" and "timemap" links in this response reflect the knowledge of the responding TimeGate, 
            not of the remote TimeGate.
          </t>
          
          <figure title="TimeGate redirects to another TimeGate" align="center" anchor="step4-tg-redirect">  
            <artwork align="left"><![CDATA[
HTTP/1.1 302 Found
Date: Thu, 21 Jan 2010 00:06:50 GMT
Server: Apache
Vary: negotiate, accept-datetime
Location: 
 http://otherarxiv.example.com/timegate/http://a.example.org
Link: <http://a.example.org>; rel="original",
 <http://arxiv.example.net/timemap/http://a.example.org>
   ; rel="timemap"; type="application/link-format",
 <http://arxiv.example.net/web/20000915112826/http://a.example.org>
   ; rel="first memento"; datetime="Tue, 15 Sep 2000 11:28:26 GMT",
 <http://arxiv.example.net/web/20080708093433/http://a.example.org>
   ; rel="last memento"; datetime="Tue, 08 Jul 2008 09:34:33 GMT",
 <http://otherarxiv.example.com/timegate/http://a.example.org>
   ; rel="timegate"
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Connection: close
]]></artwork>
          </figure>    
          
          </section>
        
        <section title="Accept-Datetime and other Accept Headers Provided" anchor="HTTP_TimeGate_server_accept">
          
          
          <t> 
            When interacting with a TimeGate, the regular content negotiation dimensions (media type, 
            character encoding, language, and compression) remain available. 
            It is the TimeGate server's responsibility to honor (or not) such 
            content negotiation, and in doing so it MUST always first select a Memento that meets 
            the user agent's datetime preference, and then 
            consider honoring regular content negotiation for it. As a result of this approach, the returned Memento will not 
            necessarily meet the user agent's regular content negotiation preferences. Therefore, it is RECOMMENDED that the server 
            provides HTTP Links with a "memento" Relation Type pointing at Mementos that do meet the user agent's regular content 
            negotiation requests and that have a value for the "Memento-Datetime" header 
            in the temporal vicinity of the user agent's preferred datetime value.
          </t>
          
        </section>         

 <section title="Accept-Datetime Unparseable" anchor="HTTP_TimeGate_server_400">

<t>
  In case, in Step 3, a user agent conveys a value for the "Accept-Datetime" request header that does 
  not conform to the accept-dt-value construction rule of the BNF in <xref target="datetime-BNF"></xref>, 
  the TimeGate server's response MUST have a "400 Bad Request" HTTP status code. The use of the "Vary" header MUST be as described in <xref target="HTTP_TimeGate_server_OK"></xref>. 
  The use of the "Link" header MUST be as described in <xref target="Link-Header-Relation-Types"></xref>.
  Specifically, the use of links with a "memento" Relation Type MUST follow the rules  
  for the case where no Memento is selected by the responding server, i.e. only "memento" links to the first and most recent Mementos 
  MUST be provided (<xref target="memento-rel"></xref>).
</t> 

 </section>
        
        <section title="Accept-Datetime Not Provided" anchor="HTTP_TimeGate_server_302">
          
          <t>
            In case, in Step 3, a user agent issues a request to a TimeGate and fails to include an "Accept-Datetime" request header, 
            the response MUST be handled as in <xref target="HTTP_TimeGate_server_OK"></xref>, with a selection of the most recent 
            Memento known to the responding server.
          </t>
          
        </section>

        <section title="TimeGate Does Not Exist" anchor="HTTP_TimeGate_server_404">
          
          <t>
            Cases may occur in which a user agent issues a request against a TimeGate that does not exist. This may, 
            for example, occur when a user agent uses internal knowledge to construct the URI of an assumed, yet non-existent TimeGate.
            In these cases, the response from the target server MUST have a "404 Not Found" HTTP status code, and SHOULD include a 
            "Vary" header that includes the "negotiate" and "accept-datetime" values as an indication that, generally, 
            the server is capable of datetime negotiation. 
            The response MUST NOT include a "Link" header with any of the Relation Types introduced in <xref target="memento-rels"></xref>, 
            and it MUST NOT contain a "Memento-Datetime" header.
          </t>
          
        </section>
        
        <section title="HTTP Methods other than HEAD/GET" anchor="TG_other">
          
          <t>
            In the above, the safe HTTP methods GET and HEAD are described for TimeGates. 
            TimeGates MAY support the safe HTTP methods OPTIONS and TRACE in the way described in <xref target="RFC2616"></xref>. 
            Unsafe HTTP methods 
            (i.e. PUT, POST, DELETE) MUST NOT be supported by a TimeGate. Such requests MUST yield 
            a response with a "405 Method Not Allowed" HTTP status code, and MUST include an "Allow" header to convey that only the
            HEAD and GET (and OPTIONALLY the OPTIONS and TRACE) methods are supported. 
            In addition, the response MUST have a "Vary" header that includes the "negotiate" and "accept-datetime" values  
            to indicate the TimeGate supports datetime negotiation. <xref target="a405-response-URI-G"></xref> shows such a 
            response.
          </t>
          
          <figure align="center" anchor="a405-response-URI-G" title="Response from a TimeGate accessed with HTTP method other than HEAD/GET">           
            <artwork align="left"><![CDATA[
HTTP/1.1 405 Method Not Allowed
Date: Thu, 21 Jan 2010 00:02:12 GMT
Server: Apache
Vary: negotiate, accept-datetime
Allow: HEAD, GET
Content-Length: 255
Connection: close
Content-Type: text/html; charset=iso-8909-1
]]></artwork>       
          </figure>   
          
        </section>

      </section>
  
  <section title="Recognizing a TimeGate" anchor="redirect_chains_tg">
    
    <t>
      When a user agent issues a HTTP HEAD/GET request against an assumed TimeGate URI 
      (e.g. URI is Target IRI of a link with a "timegate" 
      Relation Type, URI is discovered as described in <xref target="component-2"></xref>, etc.), it SHOULD NOT conclude that the 
      targeted resource effectively is a TimeGate and hence will behave 
      as described in <xref target="HTTP_TimeGate_server"></xref>. 
    </t>
    
    <t>
      A user agent MUST decide it has reached a TimeGate if the response to a HTTP HEAD/GET request against the resource's URI contains 
      a "Vary" header that includes the "negotiate" and "accept-datetime" values. If the response does not, the user agent MUST decide it has 
      not reached a TimeGate and proceed as follows:
    </t>
    
    <t><list style="symbols">     
      <t>
        If the response contains a redirection, the user agent SHOULD follow it. Note that a chain of redirections is possible, e.g. 
        URI-R -> URI-1 -> URI-2 -> ... -> URI-G
      </t>   
      <t>
        If the response does not contain a redirection, or if the redirection (chain) does not lead to a TimeGate,
        the user agent SHOULD attempt to determine an appropriate TimeGate for the 
        Original Resource, either automatically or interactively supported by the user.  
        The discovery mechanisms described in 
        <xref target="component-2"></xref> can support the user agent with this regard.
      </t>  
    </list></t>

    <t>
    Resources that are not TimeGates (i.e. do not behave as described in <xref target="HTTP_TimeGate_server"></xref>) MUST NOT 
    use a "Vary" header that includes the "accept-datetime" value. 
    </t>
    
    <t>
      In certain cases, it is possible to implement Memento support 
      in such a manner that an Original Resource coincides with its TimeGate, 
      i.e. URI-R and URI-G are the same. This implementation pattern is NOT RECOMMENDED.
      It can make determining whether a resource is a TimeGate more challenging, 
      and, more importantly, it may cause problems with caches. 
      Observed caching problems, which implementations 
      must take care to avoid, include:
    </t>
    
    <t><list style="symbols">
      <t>
        Cache invalidation when switching between a request for the Original Resource 
        and a negotiation with the TimeGate.
      </t>
      <t>
      Delivering a (cached) Original Resource response when a TimeGate response was requested, and vice versa. 
      </t>
    </list></t>
            
  </section>

</section>

<section anchor="HTTP_Memento" title="Interactions with a Memento">

 <t>This section details HTTP GET/HEAD requests targeted at a Memento (URI-M).</t>  

<section anchor="HTTP_Memento_client" title="Step 5: User Agent Requests a Memento">

<t>
In Step 5, the user agent issues a HTTP GET request against the URI of a Memento. 
The user agent MAY include an "Accept-Datetime" header in this request, but 
the existence or absence of this header MUST NOT affect the server's response.
The URI of the Memento may have resulted from a response in Step 4, or the user agent 
may simply have happened upon it.
Such a request is illustrated in <xref target="a200-step5-http"></xref>.
</t>
        
  <figure title="User agent requests Memento" align="center" anchor="a200-step5-http">  
    <artwork align="left"><![CDATA[
GET /web/20010911203610/http://a.example.org HTTP/1.1
Host: arxiv.example.net
Accept-Datetime: Tue, 11 Sep 2001 20:35:00 GMT
Connection: close
]]></artwork>
    
  </figure>       
        
</section>

<section anchor="HTTP_Memento_server" title="Step 6: Server Responds to a Request for a Memento">

  <t>This section describes possible responses to a request for a Memento. <xref target="HTTP_Memento_common"></xref> 
    discusses the common scenario, whereas <xref target="HTTP_Memento_redirect"></xref> 
    and <xref target="HTTP_Memento_other"></xref> detail special cases whereby Mementos are archived copies 
  of HTTP responses with 3xx, 4xx and 5xx status codes.</t>

  <section anchor="HTTP_Memento_common" title="Common Scenario">

<t>
If the Memento requested by the user agent in Step 5 exists, 
and is not a special Memento as described in <xref target="HTTP_Memento_redirect"></xref> 
  and <xref target="HTTP_Memento_redirect"></xref>, the server's response MUST 
  have a "200 OK" HTTP status code or, where appropriate "206 Partial Content", 
and it MUST include a "Memento-Datetime" header with a value equal to the 
archival datetime of the Memento, that is, the datetime of the state of the Original Resource that is encapsulated 
in the Memento.  
The "Link" header MUST be provided and contain links subject to the considerations described in 
  <xref target="Link-Header-Relation-Types"></xref>.
  The Target IRI and, when applicable, the datetime values in the "Link" 
  header associated with the "memento" Relation Type SHOULD be the same as conveyed in Step 4, in case the TimeGate and the selected 
  Memento reside on the same server. However, they MAY be different in case the TimeGate and the selected Memento reside on different servers.
</t>

<t>
  <xref target="a200-step6-http"></xref> illustrates the server's response to the request issued against a Memento in Step 5  
  (<xref target="a200-step5-http"></xref>).
</t> 
  
  <figure title="Server of Memento responds" align="center" anchor="a200-step6-http">   
    <artwork align="left"><![CDATA[
HTTP/1.1 200 OK
Date: Thu, 21 Jan 2010 00:09:40 GMT
Server: Apache-Coyote/1.1
Memento-Datetime: Tue, 11 Sep 2001 20:36:10 GMT
Link: <http://a.example.org>; rel="original",
 <http://arxiv.example.net/timemap/http://a.example.org>
   ; rel="timemap"; type="application/link-format", 
 <http://arxiv.example.net/timegate/http://a.example.org>
   ; rel="timegate",
 <http://arxiv.example.net/web/20000915112826/http://a.example.org>
   ; rel="first memento"; datetime="Tue, 15 Sep 2000 11:28:26 GMT",
 <http://arxiv.example.net/web/20080708093433/http://a.example.org>
   ; rel="last memento"; datetime="Tue, 08 Jul 2008 09:34:33 GMT",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org>
   ; rel="memento"; datetime="Tue, 11 Sep 2001 20:36:10 GMT",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org>
   ; rel="prev memento"; datetime="Tue, 11 Sep 2001 20:30:51 GMT",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org> 
   ; rel="next memento"; datetime="Tue, 11 Sep 2001 20:47:33 GMT"
Content-Length: 23364
Content-Type: text/html;charset=utf-8
Connection: close
]]></artwork>  
  </figure>  
  
<t>
The server's response MUST include the "Memento-Datetime" header regardless whether the user agent's 
request contained an "Accept-Datetime" header or not. This is the way by which resources make explicit that they are 
Mementos. Due to the sparseness of Mementos in most archives, 
the value of the "Memento-Datetime" header returned by a server may differ 
(significantly) from the value conveyed by the user agent in "Accept-Datetime".
</t>
  
  <t>
    Although a Memento encapsulates a prior state of an Original Resource, the entity-body returned in response to an HTTP GET 
    request issued against a Memento may very well not be byte-to-byte the same as an entity-body that was previously returned 
    by that Original Resource. Various reasons exist why there are significant chances these would be different yet do convey 
    substantially the same information. These include format migrations as part of a digital preservation strategy, 
    URI-rewriting as applied by some Web archives, and the addition of banners as a means to brand Web archives. 
  </t>

  </section>
  
  <section anchor="HTTP_Memento_redirect" title="Memento of a 3XX Response">
    
    <t>Cases exist in which HTTP responses with 3XX status codes are archived. 
    For example, crawl-based web archives commonly archive responses with 
    HTTP status codes "301 Moved Permanently" and "302 Found" whereas Linked Data 
    archives hold on to "303 See Other" responses. But also other 3XX responses 
    may be archived.</t>
    
    <t>If the Memento requested by the user agent is an archived version of an 
      HTTP response with a 3XX status code, the server's response MUST 
      have the same 3XX HTTP status code, 
      and it MUST include a "Memento-Datetime" header with a value equal to the 
      archival datetime of the original 3XX response.  
      All other considerations, e.g. pertaining to the use of "Link" header, 
      expressed in <xref target="HTTP_Memento_common"></xref> apply.</t>
    
    <t>The client's handling of a HTTP response with a 3XX status code is not 
      affected by the presence of a "Memento-Datetime" header.  The
      client SHOULD behave in the same manner as it does with HTTP responses with a 3XX 
      status code that do not have a "Memento-Datetime" header. For example:</t>
      
      <t><list style="symbols">
        <t>For a response from a Memento that has a 3XX status code and 
          contains a "Location" header, 
          the client SHOULD continue on to the URI specified in that header.</t>
        <t>For a response from a Memento that has a "300 Multiple Choices" status code, 
        the response body SHOULD be presented to the user to allow selection of a URI.</t>
      </list></t>
      
      <t>However, the client MUST be aware that the URI that was selected 
        from the HTTP response with a 3XX status code might not be that of a Memento 
        but rather of an Original Resource.
        In that case it SHOULD proceed by looking for a Memento of the 
        selected Original Resource.</t>
    
    <t>For example, on April 11 2008 <xref target="memento-redirect-2"></xref>
      is the response to an HTTP GET request for http://a.example.org. This 
      response is archived as a Memento of http://a.example.org, 
      and this Memento's URI is http://arxiv.example.net/web/20080411000650/http://a.example.org.
      The response to a HTTP HEAD/GET on this Memento is shown in <xref target="memento-redirect-3"></xref>.
    In essence, it is a replay of the original response with "Memento-Datetime" and 
    "Link" headers added, to allow a client to understand the response is a Memento. 
    In <xref target="memento-redirect-3"></xref>, the value of the "Location" 
      header is the same as in the original response; it identifies an Original Resource. 
      The client proceeds with finding a Memento for this Original Resource.
    Web archives sometimes overwrite the value that was originally provided in the 
    "Location" header in order to point at a Memento they hold 
    of the resource to which the redirect originally led. This is shown in <xref target="memento-redirect-4"></xref>.
      In this case, the client may decide it found an appropriate Memento.
    </t>

    <figure title="Response to the User Agent Request is a Redirect" align="center" anchor="memento-redirect-2">       
      <artwork align="left"><![CDATA[
HTTP/1.1 301 Moved Permanently
Date: Fri, 11 Apr 2008 00:06:50 GMT
Server: Apache
Location: http://b.example.org
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Connection: close
]]></artwork>         
    </figure>
    
    <figure title="Response to a User Agent Request for a Memento of a Redirect; leads to an Original Resource" align="center" anchor="memento-redirect-3">       
      <artwork align="left"><![CDATA[
HTTP/1.1 301 Moved Permanently
Date: Thu, 21 Jan 2010 00:09:40 GMT
Server: Apache-Coyote/1.1
Memento-Datetime: Fri, 11 Apr 2008 00:06:50 GMT
Location: http://b.example.org
Link: <http://a.example.org>; rel="original",
 <http://arxiv.example.net/timemap/http://a.example.org>
   ; rel="timemap"; type="application/link-format", 
 <http://arxiv.example.net/timegate/http://a.example.org>
   ; rel="timegate",
 <http://arxiv.example.net/web/20000915112826/http://a.example.org>
   ; rel="first memento"; datetime="Tue, 15 Sep 2000 11:28:26 GMT",
 <http://arxiv.example.net/web/20080708093433/http://a.example.org>
   ; rel="last memento"; datetime="Tue, 08 Jul 2008 09:34:33 GMT",
 <http://arxiv.example.net/web/20080411000650/http://a.example.org>
   ; rel="memento"; datetime="Fri, 11 Apr 2008 00:06:50 GMT",
 <http://arxiv.example.net/web/20080410203051/http://a.example.org>
   ; rel="prev memento"; datetime="Thu, 10 Apr 2008 20:30:51 GMT",
 <http://arxiv.example.net/web/20080412204733/http://a.example.org> 
   ; rel="next memento"; datetime="Sat, 12 Apr 2008 20:47:33 GMT"
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Connection: close
]]></artwork>         
    </figure>
    
    <figure title="Response to a User Agent Request for a Memento of a Redirect; leads to a Memento" align="center" anchor="memento-redirect-4">       
      <artwork align="left"><![CDATA[
HTTP/1.1 301 Moved Permanently
Date: Thu, 21 Jan 2010 00:09:40 GMT
Server: Apache-Coyote/1.1
Memento-Datetime: Fri, 11 Apr 2008 00:06:50 GMT
Location: 
 http://arxiv.example.net/web/20080411000655/http://b.example.org
Link: <http://a.example.org>; rel="original",
 <http://arxiv.example.net/timemap/http://a.example.org>
   ; rel="timemap"; type="application/link-format", 
 <http://arxiv.example.net/timegate/http://a.example.org>
   ; rel="timegate",
 <http://arxiv.example.net/web/20000915112826/http://a.example.org>
   ; rel="first memento"; datetime="Tue, 15 Sep 2000 11:28:26 GMT",
 <http://arxiv.example.net/web/20080708093433/http://a.example.org>
   ; rel="last memento"; datetime="Tue, 08 Jul 2008 09:34:33 GMT",
 <http://arxiv.example.net/web/20080411000650/http://a.example.org>
   ; rel="memento"; datetime="Fri, 11 Apr 2008 00:06:50 GMT",
 <http://arxiv.example.net/web/20080410203051/http://a.example.org>
   ; rel="prev memento"; datetime="Thu, 10 Apr 2008 20:30:51 GMT",
 <http://arxiv.example.net/web/20080412204733/http://a.example.org> 
   ; rel="next memento"; datetime="Sat, 12 Apr 2008 20:47:33 GMT"
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Connection: close
]]></artwork>         
    </figure>
    
  </section>
  
  <section anchor="HTTP_Memento_other" title="Memento of Responses with Other HTTP Status Codes">
    
    <t>Cases exist in which responses with 4xx and 5xx HTTP status codes are archived.
      If the Memento requested by the user agent is an archived version of such an 
      HTTP response, the server's response MUST 
      have the same 4xx or 5xx HTTP status code, 
      and it MUST include a "Memento-Datetime" header with a value equal to the 
      archival datetime of the original response.  
      All other considerations, e.g. pertaining to the use of "Link" header, 
      expressed in <xref target="HTTP_Memento_common"></xref> apply.</t>
    
    <t>For example, on April 11 2008, <xref target="memento-4xx-2"></xref>
      is the 404 response to an HTTP GET request for http://a.example.org. This 
      response is archived as a Memento of http://a.example.org, 
      and this Memento's URI is http://arxiv.example.net/web/20080411000650/http://a.example.org.
      The response to a HTTP HEAD/GET on this Memento is shown in <xref target="memento-4xx-3"></xref>.
      It is a replay of the original response with "Memento-Datetime" and 
      "Link" headers added, to allow a client to understand the response is a Memento.</t>
    
    <figure title="Response to the User Agent Request is a 404" align="center" anchor="memento-4xx-2">       
      <artwork align="left"><![CDATA[
HTTP/1.1 404 Not Found
Date: Fri, 11 Apr 2008 00:06:50 GMT
Server: Apache
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Connection: close
]]></artwork>         
    </figure>
    
    <figure title="Response to a User Agent Request for a Memento of a 404 Response" align="center" anchor="memento-4xx-3">       
      <artwork align="left"><![CDATA[
HTTP/1.1 404 Not Found
Date: Thu, 21 Jan 2010 00:09:40 GMT
Server: Apache-Coyote/1.1
Memento-Datetime: Fri, 11 Apr 2008 00:06:50 GMT
Link: <http://a.example.org>; rel="original",
 <http://arxiv.example.net/timemap/http://a.example.org>
   ; rel="timemap"; type="application/link-format", 
 <http://arxiv.example.net/timegate/http://a.example.org>
   ; rel="timegate",
 <http://arxiv.example.net/web/20000915112826/http://a.example.org>
   ; rel="first memento"; datetime="Tue, 15 Sep 2000 11:28:26 GMT",
 <http://arxiv.example.net/web/20080708093433/http://a.example.org>
   ; rel="last memento"; datetime="Tue, 08 Jul 2008 09:34:33 GMT",
 <http://arxiv.example.net/web/20080411000650/http://a.example.org>
   ; rel="memento"; datetime="Fri, 11 Apr 2008 00:06:50 GMT",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org>
   ; rel="prev memento"; datetime="Thu, 10 Apr 2008 20:30:51 GMT",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org> 
   ; rel="next memento"; datetime="Sat, 12 Apr 2008 20:47:33 GMT"
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Connection: close
]]></artwork>         
    </figure>
    
  </section>
  
  <section title="Mementos Without a TimeGate" anchor="HTTP_Memento_no_TimeGate">
    
    <t>
      Cases may occur in which a server that hosts Mementos does not expose a TimeGate for those Mementos. 
      This can, for example, be the case if the server's Mementos result from taking a 
      snapshot of the state of a set of Original Resources from another server at the time this other server is being retired. 
      As a result, only a single Memento per Original Resource is hosted, making the introduction of a TimeGate 
      unnecessary. But it may also be the case for servers that hosts multiple Mementos for an Original Resource but consider 
      exposing TimeGates too expensive.
    </t>
    
    <t>
      In cases of Mementos without associated TimeGates, responses to a request for a Memento by a user agent MUST be as described in 
      <xref target="HTTP_Memento_server"></xref> with the exception that it will not contain a HTTP "Link" 
      with a &quot;timegate&quot; Relation Type pointing at a TimeGate exposed by the responding server. It MAY still 
      contain such a Link pointing at a TimeGate exposed elsewhere. Depending on whether one or more Mementos are hosted for 
      an Original Resource, the response may or may not have a 
      HTTP Link with a &quot;timemap&quot; Relation Type.
      However, the response MUST still contain a "Memento-Datetime" response header 
      with a value 
      that corresponds to archival datetime of the Memento. 
    </t>
    
    <t>
      <xref target="a200-step6-no-timegate"></xref> illustrates the server's response to the request  
      issued against a Memento in Step 5 (<xref target="a200-step5-http"></xref>) for the case that Memento has no 
      associated TimeGate. In this example, it is also assumed there is only one Memento for the Original Resource, 
      and hence the Links with Relation Types 
      &quot;memento&quot;, &quot;first&quot;, &quot;last&quot; all point at the same - responding - Memento. 
    </t> 
    
    <figure title="Server of Memento without TimeGate responds" align="center" anchor="a200-step6-no-timegate">   
      <artwork align="left"><![CDATA[
HTTP/1.1 200 OK
Date: Thu, 21 Jan 2010 00:09:40 GMT
Server: Apache-Coyote/1.1
Memento-Datetime: Tue, 11 Sep 2001 20:36:10 GMT
Link: <http://a.example.org>; rel="original",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org>
   ; rel="first last memento"
   ; datetime="Tue, 15 Sep 2000 11:28:26 GMT"
Content-Length: 23364
Content-Type: text/html;charset=utf-8
Connection: close
]]></artwork>  
    </figure>  
    
    <t>Note that a server issuing a response similar to that of <xref target="a200-step6-no-timegate"></xref> 
      does not imply that there is no server whatsoever that exposes a TimeGate; it merely means that the responding 
      server neither provides nor is aware of the location of a TimeGate.</t>
    
  </section>

<section title="Memento Does not Exist" anchor="HTTP_Memento_server_404">

<t>
Cases may occur in which a TimeGate's response (Step 4) points at a Memento that actually does not exist, resulting in a user agent's request 
(Step 5) for a non-existent Memento. In this case, the server's response MUST have the expected "404 Not Found" HTTP Status Code and it MUST NOT 
contain a "Memento-Datetime" header.
Note that the absence of a Memento in an archive is distinct from the case 
of an archived response with a "404 Not Found" HTTP status code as is described in 
  <xref target="HTTP_Memento_other"></xref>
</t>

</section>
  



</section>
  
  <section title="Recognizing a Memento" anchor="redirect_chains_m">
    
    <t>
      When following the redirection provided by a confirmed TimeGate (see <xref target="redirect_chains_tg"></xref>), 
      a user agent SHOULD NOT assume that the targeted resource effectively is a Memento and hence will behave as described in 
      <xref target="HTTP_Memento_server"></xref>.
    </t>
      
      <t>
      A user agent MUST decide it has reached a Memento if the response to a 
      HTTP HEAD/GET request against the resource's URI contains a "Memento-Datetime" header with a legitimate value. 
      If the response does not, the following applies:
      </t>
      
      <t><list style="symbols">    
    <t>
      If the response contains a redirection, the user agent SHOULD follow it. Even a chain of redirections is possible, e.g. 
      URI-G -> URI-X -> URI-Y -> ... -> URI-M.
    </t>  
        <t>If the response by a confirmed TimeGate does not contain a redirection, or if the redirection (chain) that started at a 
          confirmed TimeGate does not lead to a 
          resource that provides a "Memento-Datetime" header, the user agent MAY still conclude that it has likely arrived at a Memento. 
          That is because cases exist in which Web 
      archives and CMS are made compliant with the Memento framework "by proxy". In these cases TimeGates will redirect to Mementos 
      in such systems, but the responses from these Mementos will not (yet) include a "Memento-Datetime" header. 
    </t>   
      </list></t>
 
  </section>

</section>

    <section title="Interactions with a TimeMap" anchor="timemap">
     
      
      <t>A TimeMap is introduced to support retrieving a comprehensive list of all Mementos for a specific Original Resource,  
        known to a responding server. 
        The entity-body of a response to an HTTP GET request issued against a TimeMap's URI:</t>
      <t><list style="symbols">
        <t>MUST list the URI of the Original Resource that the TimeMap is about;</t>
        <t>MUST preferably list the URI and datetime of each Memento for the Original Resource known to the responding server, or, alternatively support assembling such a list by following 
          links with a "timemap" Relation Type provided in the TimeMap;
        </t>   
        <t>MUST list the URI of one or more TimeGates for the Original Resource known to the responding server;</t>
        <t>SHOULD, for self-containment, list the URI of the TimeMap itself;</t>
        <t>MUST unambiguously type listed resources as being Original Resource, TimeGate, Memento, or TimeMap.</t>
      </list></t>
      
      <t>
        The entity-body of a response from a TimeMap MAY be serialized in various ways, 
        but the link-value format serialization MUST be supported. 
        In this serialization, the entity-body MUST be formatted in the same way as 
        the value of a HTTP "Link" header, and hence MUST comply to the "link-value" 
        construction rule of "Section 5. The Link Header Field" of <xref target="RFC5988"></xref>, and the media type 
        of the entity-body MUST be "application/link-format" as introduced in 
        <xref target="I-D.ietf-core-link-format"></xref>. 
        All links conveyed in this serialization MUST be interpreted as having  
        the URI of the Original Resource as their Context IRI. The URI of the Original Resource is provided in the entity-body 
        as the Target IRI 
        of the link with an "original" Relation Type.
      </t>
   
      <section anchor="HTTP_TimeMap_client" title="User Agent Requests a TimeMap"> 
        
        <t>
          In order to retrieve the link-value serialization of a TimeMap, a user agent SHOULD use an 
          "Accept" request header with a value set to "application/link-format". 
          This is shown in <xref target="TimeMap-request"></xref>.
        </t>
        
        <figure align="center" anchor="TimeMap-request" title="Request for a TimeMap">  
          <artwork align="left"><![CDATA[
GET /timemap/http://a.example.org HTTP/1.1
Host: arxiv.example.net
Accept: application/link-format;q=1.0
Connection: close
]]></artwork> 
        </figure>
        
        </section>
   
      <section anchor="HTTP_TimeMap_server" title="Server Responds to a Request for a TimeMap"> 
        
        <t>If the TimeMap requested by the user agent exists, 
          the server's response MUST have a "200 OK" HTTP status code (or "206 Partial Content", where appropriate). 
          Note that a TimeMap is itself an Original Resource for which Mementos may exist. For example, 
          a response from a TimeMap could provide a "timegate" Link to a TimeGate via which prior TimeMap versions are available. 
          In this case, the use of the "Link" header is subject to all considerations described in 
          <xref target="Link-Header-Relation-Types"></xref>, with the TimeMap acting as the Original Resource.</t> 
          
        <t>However, in case a TimeMap wants to explicitly indicate in its response headers  
          for which Original Resource it is a TimeMap, 
          it MUST do so by including a HTTP "Link" header with the following characteristics:</t>
        
        <t><list style="symbols">
          <t>The Context IRI for the HTTP Link is the URI of the Original Resource;</t>
          <t>The Relation Type is "timemap";</t>
          <t>The Target IRI for the HTTP Link is the URI of the TimeMap.</t>   
        </list></t>
        <t>Because the Context IRI of this HTTP Link is not the URI of the TimeMap, as per <xref target="RFC5988"></xref>, 
          the default Context IRI must be overwritten 
          by using the "anchor" attribute with a value of the URI of the Original Resource.</t>
        
        <t>The response from the TimeMap to the request of <xref target="TimeMap-request"></xref> is shown in 
          <xref target="TimeMap-response"></xref>. The response header shows the TimeMap 
          explicitly conveying the URI of the Original Resource for which it is a TimeMap;
          for practical reasons the entity-body in the example has been abbreviated. 
          Notice also the use of the "self" Relation Type on the "timemap" link in the TimeMap.</t>       
      
      <figure align="center" anchor="TimeMap-response" title="Response from a TimeMap">   
        <artwork align="left"><![CDATA[
HTTP/1.1 200 OK
Date: Thu, 21 Jan 2010 00:06:50 GMT
Server: Apache
Link: <http://arxiv.example.net/timemap/http://a.example.org> 
   ; anchor="http://a.example.org"; rel="timemap"
   ; type="application/link-format"
Content-Length: 4883
Content-Type: application/link-format
Connection: close

 <http://a.example.org>;rel="original",
 <http://arxiv.example.net/timemap/http://a.example.org>
   ; rel="timemap self";type="application/link-format",
 <http://arxiv.example.net/timegate/http://a.example.org>
   ; rel="timegate",
 <http://arxiv.example.net/web/20000620180259/http://a.example.org>
   ; rel="first memento";datetime="Tue, 20 Jun 2000 18:02:59 GMT", 
 <http://arxiv.example.net/web/20091027204954/http://a.example.org>
    ; rel="last memento";datetime="Tue, 27 Oct 2009 20:49:54 GMT",
 <http://arxiv.example.net/web/20000621011731/http://a.example.org>
   ; rel="memento";datetime="Wed, 21 Jun 2000 01:17:31 GMT",
 <http://arxiv.example.net/web/20000621044156/http://a.example.org>
   ; rel="memento";datetime="Wed, 21 Jun 2000 04:41:56 GMT",
 ...
]]></artwork>   
      </figure>
      
        <t>Cases exist in which a TimeMap points at several other TimeMaps. In one such case, a TimeMap could merely point at other TimeMaps and not list any Mementos itself. 
          This can happen when Mementos are spread across several archives that share a front-end.
          Such a TimeMap can be considered an index of TimeMaps and is shown in <xref target="TimeMap-index"></xref>. Note the use of the Relation Types 
          "self" and index" when pointing to the index TimeMap itself, and "first" and "last" to point at remote TimeMaps that contain information on the earliest and most recent Mementos, respectively. 
          Another case is when the number of 
          available Mementos requires introducing multiple TimeMaps that can be paged. Such a TimeMap is shown in <xref target="TimeMap-paging"></xref>; Note the use of 
        the "self" Relation Type when pointing at the current TimeMap itself, and the use of "first", "last", "prev", and "next" to point at others. Note that this TimeMap also lists actual Mementos.</t>     
      
        <figure align="center" anchor="TimeMap-index" title="An index TimeMap">   
          <artwork align="left"><![CDATA[
<http://a.example.org>;rel="original",
 <http://arxiv.example.net/timegate/http://a.example.org>
   ; rel="timegate",
 <http://arxiv.example.net/timemap/http://a.example.org>
   ; rel="timemap self index";type="application/link-format",
 <http://arxiv1.example.net/timemap/http://a.example.org>
   ; rel="timemap first";type="application/link-format",
 <http://arxiv2.example.net/timemap/http://a.example.org>
   ; rel="timemap";type="application/link-format"
    <http://arxiv3.example.net/timemap/http://a.example.org>
   ; rel="timemap last";type="application/link-format"
]]></artwork>   
        </figure>
      
        <figure align="center" anchor="TimeMap-paging" title="TimeMap Paging">   
          <artwork align="left"><![CDATA[
<http://a.example.org>;rel="original",
 <http://arxiv.example.net/timegate/http://a.example.org>
   ; rel="timegate",
 <http://arxiv.example.net/timemap/3/http://a.example.org>
   ; rel="timemap self";type="application/link-format",
 <http://arxiv.example.net/timemap/1/http://a.example.org>
   ; rel="timemap first";type="application/link-format",
 <http://arxiv.example.net/timemap/6/http://a.example.org>
   ; rel="timemap last";type="application/link-format",   
  <http://arxiv.example.net/timemap/2/http://a.example.org>
   ; rel="timemap prev";type="application/link-format",
  <http://arxiv.example.net/timemap/4/http://a.example.org>
   ; rel="timemap next";type="application/link-format",
 <http://arxiv.example.net/timemap/5/http://a.example.org>
   ; rel="timemap";type="application/link-format", 
 <http://arxiv.example.net/web/20000620180259/http://a.example.org>
   ; rel="memento";datetime="Tue, 20 Jun 2000 18:02:59 GMT", 
 <http://arxiv.example.net/web/20091027204954/http://a.example.org>
    ; rel="memento";datetime="Tue, 27 Oct 2009 20:49:54 GMT",
 <http://arxiv.example.net/web/20000621011731/http://a.example.org>
   ; rel="memento";datetime="Wed, 21 Jun 2000 01:17:31 GMT",
 <http://arxiv.example.net/web/20000621044156/http://a.example.org>
   ; rel="memento";datetime="Wed, 21 Jun 2000 04:41:56 GMT",
 ...
]]></artwork>   
        </figure>
      
      
   </section>
      
    </section>

</section>

<section title="The Memento Framework, Discovery of TimeGates and TimeMaps" anchor="component-2">

  <t><xref target="component-1.2"></xref> describes how TimeGates, Mementos, Original Resources, and TimeMaps can be discovered 
  by following HTTP Links with Relation Types "timegate", "memento", "original", and "timemap", respectively.</t>
  
  <t>Naturally, some of these links can also be included in representations of resources that 
  have a media type that allows embedding typed links. For example, an Original Resource that 
  has an HTML representation can include a "timegate" link by using HTML's LINK element, e.g. 
  &lt;link href="http://arxiv.example.net/timegate/http://a.example.org" rel="timegate"&gt;. 
  The use of such embedded links is also subject to the considerations of <xref target="Link-Header-Relation-Types"></xref>.</t> 
 
  <t>In this section an additional approach is introduced to support batch discovery of TimeGates and TimeMaps. 
    The approach leverages the well-known URI <xref target="RFC5785"></xref> and host-meta <xref target="RFC6415"></xref> specifications.
    It can be used in cases where the URI of a TimeGate or TimeMap has as part of its path-component the URI of the associated Original Resource. 
    This is commonly the case for web archives and CMS that support the Memento protocol. The approach uses the following variables for 
  URI templates used in host-meta files:</t>
    
  <t><list style="symbols">
    <t>The "uri" variable, as reserved by <xref target="RFC6415"></xref>, which stands for any URI in the server's document scope.</t>
    <t>The "anyuri" variable, introduced here, which stands for any URI, i.e. not just URIs in the server's document scope.</t>
    <t>The "path" variable, introduced here, which stands for any path and/or query component that can be added to the URI that precedes the variable 
      in the URI template.</t>
  </list></t>
  
  <t>A server SHOULD make TimeGates discoverable in the following way:</t>
  
  <t><list style="symbols">
    <t>As per <xref target="RFC5785"></xref> and <xref target="RFC6415"></xref>, the server publishes a document with the name "host-meta" in its /.well-known/ path.</t>
    <t>As per <xref target="RFC6415"></xref>, the host-meta document uses the XRD 1.0 document format.</t>
    <t>The host-meta document includes one or more "Link" elements to support discovery of TimeGates for the server's Original Resources. 
      Each such Link element has a value of "timegate" for its "rel" attribute, and it 
      has a "template" attribute that has a URI template as its value. The URI template MAY either use the "uri", "anyuri", or "path" variable.
    </t>
    <t>The URI template MUST be such that, when applying the URI of an Original Resource to the "uri" or "anyuri" variable, or when applying a 
      path and/or query component of an Original Resource's URI to the "path" variable, the URI of a potential TimeGate for that 
      Original Resource results. 
    </t>
    <t>Because Mementos do not exist for all possible URIs, there are no guarantees that these resulting TimeGates effectively exist. But URI templates 
    should be created to try and maximize chances that the TimeGate effectively exists.</t>
  </list></t>
  
  <t>The considerations described for TimeGate discovery also apply to TimeMap discovery. However, for TimeMaps, each Link element has 
  a value of "timemap" for its "rel" attribute.</t>
  
  <t><xref target="host-meta-1"></xref> and <xref target="host-meta-2"></xref> illustrate how a server makes TimeGates associated with its own 
    Original Resources discoverable, whereas <xref target="host-meta-3"></xref> illustrates how a web archive that hosts Mementos for 
    Original Resources originating from various domains makes its TimeGates and TimeMaps discoverable.
  </t> 

  <t><xref target="host-meta-1"></xref> shows a host-meta document published at http://a.example.org/.well-known/host-meta  
    by a wiki that has http://a.example.org as its base URI. The document supports discovery of 
    TimeGates that allow accessing prior versions of the wiki's Original Resources. The URI template uses the "uri" variable to 
    stand for a document in the wiki's document range. Assuming http://a.example.org/w/Clock is the URI of an Original Resource on the wiki, 
    applying the template to that URI yields http://a.example.org/Special:TimeGate/http://a.example.org/w/Clock as its corresponding TimeGate.</t>
  
  <figure align="center" anchor="host-meta-1" title="A host-meta Document Supporting TimeGate Discovery for a Wiki's Original Resources">   
    <artwork align="left"><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
 <XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'
       xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  <Link rel='timegate' 
        template='http://a.example.org/Special:TimeGate/{uri}'>
  </Link>
 </XRD>
]]></artwork>   
  </figure>
  
  <t><xref target="host-meta-2"></xref> shows a host-meta document published at http://a.example.org/.well-known/host-meta by the server with base URI 
    http://a.example.org to support discovery of 
    TimeGates for its Original Resources. The example shows that the URI of TimeGates differs depending on the server path. 
    Assuming http://a.example.org/b/Clock is the URI of an Original Resource on the wiki, 
    applying that URI to the appropriate template yields http://a2.example.net/tg/http://a.example.org/b/Clock as its corresponding TimeGate.</t>
  
  <figure align="center" anchor="host-meta-2" title="A host-meta Document Supporting TimeGate Discovery for a Server's Original Resources">   
    <artwork align="left"><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
 <XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'
      xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  <Link rel='timegate' 
   template='http://a1.example.net/tg/http://a.example.org/a{path}'>
  </Link>
  <Link rel='timegate' 
   template='http://a2.example.net/tg/http://a.example.org/b{path}'>
  </Link>
 </XRD>
]]></artwork>   
  </figure>

  <t><xref target="host-meta-3"></xref> shows a host-meta document published at http://arxiv.example.net/.well-known/host-meta 
    by a web archive that has http://arxiv.example.net/ as its base URI. The document supports discovery of TimeGates and TimeMaps 
    that the archive exposes, and that are associated with Original Resources for which the archive holds Mementos. The URI templates use the 
  "anyuri" variable, which is an indication that the web archive holds Mementos for a wide variety of domains.</t>

  <figure align="center" anchor="host-meta-3" title="A host-meta Document Supporting Discovery of TimeGates and TimeMaps Exposed by a Web Archive">   
    <artwork align="left"><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
 <XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'
      xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  <Link rel='timegate' 
        template='http://arxiv.example.net/timegate/{anyuri}'>
  </Link>
  <Link rel='timemap' 
        template='http://arxiv.example.net/timemap/{anyuri}'>
  </Link>
 </XRD>
]]></artwork>   
  </figure>

 </section>
  
  <section anchor="IANA" title="IANA Considerations">
    
    <t>
      This memo requires IANA to register the Accept-Datetime and Memento-Datetime HTTP headers defined in 
      <xref target="Accept-Memento-Datetime"></xref> in the appropriate IANA registry.
    </t>
    
    <t>
      This memo requires IANA to register the "Link" header Relation Types &quot;original&quot;, &quot;timegate&quot;,  
      &quot;timemap&quot;, and &quot;memento&quot; defined in 
      <xref target="memento-rels"></xref> in the appropriate IANA registry.
    </t>
    
    <t>
      This memo requires IANA to register the "datetime" attribute for "Link" headers with a &quot;memento&quot; Relation Type, 
      as defined in <xref target="memento-rel"></xref> in the appropriate IANA registry.
    </t>
    

    
  </section>



    <!-- Possibly a 'Contributors' section ... -->







    <section anchor="Security" title="Security Considerations">

<!-- 
      See RFC 3552 for a guide.
-->
      
      <t>Provision of a "timegate" HTTP "Link" header in responses to requests
        for an Original Resource that is protected (e.g., 401 or 403 HTTP
        response codes) is OPTIONAL. The inclusion of this Link when
        requesting authentication is at the server's discretion; cases may
        exist in which a server protects the current state of a resource,
        but supports open access to prior states and thus chooses to
        supply a "timegate" HTTP "Link" header.  Conversely, the server may
        choose to not advertise the TimeGate URIs (e.g., they exist in an
        intranet archive) for unauthenticated requests.</t>
        
        <t>Authentication, encryption and other security related issues are
        otherwise orthogonal to Memento.</t>
      
    </section>
  
  <section title="Changelog">
    
    <t>v04 2012-05-18  HVDS MLN RS  draft-vandesompel-memento-04</t>
    <t><list style="symbols">
      <t>Removed the possibility to use an interval indicator in an Accept-Datetime header as no one is implementing it.</t>
      <t>Corrected typo in Other Relation Types table.</t>
      <t>Added TimeMap examples to illustrate index of TimeMaps and TimeMap paging.</t>
      <t>Changed Discovery component from using robots.txt with Memento-specific add-ons to well-known URI and host-meta.</t>
      <t>Removed "embargo" and "license" attributes for links with a "memento" Relation Type because no one is using them.</t>
    </list></t>
    
    
    <t>v04 2011-12-20  HVDS MLN RS  draft-vandesompel-memento-03</t>
    <t><list style="symbols">
      <t>Added description of Mementos of HTTP responses with 3XX, 4XX and 5XX 
      status code.</t>
      <t>Clarified that a TimeGate must not use the "Memento-Datetime" header.</t>
      <t>Added wording to warn for possible cache problems with Memento
      implementations that choose to have an Original Resource and and its TimeGate 
      coincide.</t>
      </list></t>
    
    <t>v03 2011-05-11  HVDS MLN RS  draft-vandesompel-memento-02</t>
    <t><list style="symbols">
      <t>Added scenario in which a TimeGate redirects to another TimeGate.</t>
      <t>Reorganized TimeGate section to better reflect the difference between requests with and without 
      interval indicator.</t>
      <t>Added recommendation to provide "memento" links to Mementos in the vicinity of the preferred interval 
         provided by the client, in case of a 406 response.</t>
      <t>Removed TimeMap Feed material from the Discovery section as a result of discussions regarding (lack of) 
        scalability of the approach with representatives of the International Internet Preservation Consortium.
      An alternative approach to support batch discovery of Mementos will be specified.</t>
    </list></t>
    <t>v02 2011-04-28  HVDS MLN RS  draft-vandesompel-memento-01</t>
    <t><list style="symbols">
      <t>Introduced wording and reference to indicate a Memento is a FixedResource.</t>
      <t>Introduced "Sticky Memento-Datetime" notion and clarified wording about retaining 
      "Memento-Datetime" headers and values when a Memento is mirrored at different URI.</t>
      <t>Introduced section about handling both datetime and regular negotiation.</t>
      <t>Introduced section about Mementos Without TimeGate.</t>
      <t>Made various changes in the section Relation Type "memento", including addition of "license" and "embargo" attributes, 
      and clarification of rules regarding the use of "memento" links.</t>
      <t>Moved section about TimeMaps inside the Datetime Negotiation section, and updated it.</t>
      <t>Restarted the Discovery section from scratch.</t>
    </list></t>
    <t>v01 2010-11-11  HVDS MLN RS  First public version draft-vandesompel-memento-00</t>
    <t>v00 2010-10-19  HVDS MLN RS Limited circulation version</t>
    <t>2010-07-22  HVDS MLN   First internal version</t>

    
  </section>
  
  <section anchor="Acknowledgements" title="Acknowledgements">
    
    <t>The Memento effort is funded by the Library of Congress. 
      Many thanks to Kris Carpenter Negulescu, Michael Hausenblas, Erik Hetzner, Larry Masinter, Gordon Mohr, Mark Nottingham, David Rosenthal, Ed Summers for early feedback.
      Many thanks to Samuel Adams, Scott Ainsworth, Lyudmilla Balakireva, Frank McCown, Harihar Shankar, Brad Tofel for early implementations.</t>
    
  </section>

</middle>



  <!--  *****BACK MATTER ***** -->



  <back>

    <!-- References split into informative and normative -->



    <!-- There are 2 ways to insert reference entries from the citation libraries:

     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)

     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here

        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")



     Both are cited textually in the same manner: by using xref elements.

     If you use the PI option, xml2rfc will, by default, try to find included files in the same

     directory as the including file. You can also define the XML_LIBRARY environment variable

     with a value containing a set of directories to search.  These can be either in the local

     filing system or remote ones accessed by http (http://domain/dir/... ).-->



    <references title="Normative References">

&RFC5988;
&I-D.ietf-core-link-format;
&RFC2616;
&RFC2119;
&RFC5829;
&RFC4287;
&RFC4151;
&RFC5785;
&RFC6415;

    </references>

    <references title="Informative References">

      <!-- Here we use entities that we defined at the beginning. -->

&RFC1123;
&I-D.masinter-dated-uri;



      <!-- A reference written by an organization not a person. -->

      <reference anchor="W3C.gen-ont-20090420"
        target="http://www.w3.org/2006/gen/ont">
        <front>
          <title>Architecture of the World Wide Web</title>
          <author surname="Berners-Lee" fullname="Tim">
            <organization/>
          </author>
          <date day="20" month="April" year="2009" />
        </front>
      </reference>

      <reference anchor="W3C.REC-aww-20041215"
        target="http://www.w3.org/TR/webarch/">
        <front>
          <title>Architecture of the World Wide Web</title>
          <author surname="Jacobs" fullname="Ian Jacobs">
            <organization/>
            </author>
            <author surname="Walsh" fullname="Norman Walsh">
              <organization/>
          </author>
          <date day="15" month="December" year="2004" />
        </front>
      </reference>
      
      
      <reference anchor="Fitch"
        target="http://ausweb.scu.edu.au/aw03/papers/fitch/paper.html">
        <front>
          <title>Web site archiving - an approach to recording every materially different response produced by a website</title>
          <author surname="Fitch" fullname="Kent Fitch">
            <organization/>
          </author>
          <date day="5" month="July" year="2003" />
        </front>
      </reference>
      
      <reference anchor="robotstxt.org"
        target="http://www.robotstxt.org/robotstxt.html">
        <front>
          <title>Robots Exclusion Protocol</title>
          <author/>
          <date day="23" month="August" year="2010" />
        </front>
      </reference>

    </references>




<section anchor="AppendixFlow" title="Appendix B: A Sample, Successful Memento Request/Response cycle">
  
  <figure title="A successful flow with TimeGate and Mementos on the same server" align="center">
    
    <artwork align="left"><![CDATA[
Step 1 : UA --- HTTP GET/HEAD; Accept-Datetime: Tj ---------> URI-R
      
HEAD / HTTP/1.1
Host: a.example.org
Accept-Datetime: Tue, 11 Sep 2001 20:35:00 GMT
Connection: close

Step 2 : UA <-- HTTP 200; Link: URI-G ----------------------- URI-R

HTTP/1.1 200 OK
Date: Thu, 21 Jan 2010 00:02:12 GMT
Server: Apache
Link: <http://arxiv.example.net/timegate/http://a.example.org>
   ; rel="timegate"
Content-Length: 255
Connection: close
Content-Type: text/html; charset=iso-8859-1

Step 3 : UA --- HTTP GET/HEAD; Accept-Datetime: Tj ---------> URI-G

GET /timegate/http://a.example.org 
 HTTP/1.1
Host: arxiv.example.net
Accept-Datetime: Tue, 11 Sep 2001 20:35:00 GMT
Connection: close

Step 4 : UA <-- HTTP 302; Location: URI-Mj; Vary; Link:
    URI-R, URI-T, URI-M0, URI-Mn, URI-Mi, URI-Mj, URI-Mk ---- URI-G
    
HTTP/1.1 302 Found
Date: Thu, 21 Jan 2010 00:06:50 GMT
Server: Apache
Vary: negotiate, accept-datetime
Location: 
 http://arxiv.example.net/web/20010911203610/http://a.example.org
Link: <http://a.example.org>; rel="original",
 <http://arxiv.example.net/web/20000915112826/http://a.example.org>
   ; rel="first memento"; datetime="Tue, 15 Sep 2000 11:28:26 GMT",
 <http://arxiv.example.net/web/20080708093433/http://a.example.org>
   ; rel="last memento"; datetime="Tue, 08 Jul 2008 09:34:33 GMT",
 <http://arxiv.example.net/timemap/http://a.example.org>
   ; rel="timemap"; type="application/link-format",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org>
   ; rel="memento"; datetime="Tue, 11 Sep 2001 20:36:10 GMT",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org>
   ; rel="prev memento"; datetime="Tue, 11 Sep 2001 20:30:51 GMT",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org> 
   ; rel="next memento"; datetime="Tue, 11 Sep 2001 20:47:33 GMT"
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Connection: close

Step 5 : UA --- HTTP GET URI-Mj; Accept-Datetime: Tj -------> URI-Mj

GET /web/20010911203610/http://a.example.org 
 HTTP/1.1
Host: arxiv.example.net
Accept-Datetime: Tue, 11 Sep 2001 20:35:00 GMT
Connection: close

Step 6 : UA <-- HTTP 200; Memento-Datetime: Tj; Link: URI-R, 
    URI-T, URI-G, URI-M0, URI-Mn, URI-Mi, URI-Mj, URI-Mk ---- URI-Mj

HTTP/1.1 200 OK
Date: Thu, 21 Jan 2010 00:09:40 GMT
Server: Apache-Coyote/1.1
Memento-Datetime: Tue, 11 Sep 2001 20:36:10 GMT
Link: <http://a.example.org>; rel="original",
 <http://arxiv.example.net/web/20000915112826/http://a.example.org>
   ; rel="first memento"; datetime="Tue, 15 Sep 2000 11:28:26 GMT",
 <http://arxiv.example.net/web/20080708093433/http://a.example.org>
   ; rel="last memento"; datetime="Tue, 08 Jul 2008 09:34:33 GMT",
 <http://arxiv.example.net/timemap/http://a.example.org>
   ; rel="timemap"; type="application/link-format", 
 <http://arxiv.example.net/timegate/http://a.example.org>
   ; rel="timegate",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org>
   ; rel="memento"; datetime="Tue, 11 Sep 2001 20:36:10 GMT",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org>
   ; rel="prev memento"; datetime="Tue, 11 Sep 2001 20:30:51 GMT",
 <http://arxiv.example.net/web/20010911203610/http://a.example.org> 
   ; rel="next memento"; datetime="Tue, 11 Sep 2001 20:47:33 GMT"
Content-Length: 23364
Content-Type: text/html;charset=utf-8
Connection: close
]]></artwork>
    
  </figure>

</section>


  </back>

</rfc>

