Accept-Datetime
Web archives store snapshots of pages over time, and retrieving a specific snapshot requires datetime negotiation. The Accept-Datetime request header asks the server for a historical version of a resource captured at or near a specific date and time.
Usage
The Accept-Datetime header is part of the Memento protocol, a framework for accessing past versions of web resources. When a client sends this header with a date value, the server looks for an archived snapshot (called a Memento) closest to the requested date.
The Memento protocol defines several roles. An original resource (the live page) is hosted on a regular server. A TimeGate is an endpoint accepting datetime negotiation and redirecting to the best-matching Memento. A TimeMap lists all available Mementos for a given resource.
The Memento served at the end of the negotiation carries a Memento-Datetime response header indicating the exact capture date of the snapshot. A TimeGate answering with 302 Found sends the Location and a Link header naming the original resource, and the specification forbids Memento-Datetime on the redirect itself. The Memento the redirect points to carries the header, and so does a TimeGate answering in 200 style with the Memento content directly.
Discovery starts at the original resource. A server
taking part in Memento adds
Link: <https://archive.example.re/timegate/...>; rel="timegate"
to responses for the live page, so a client knows
where to send Accept-Datetime. Without the link,
clients fall back to archives they already know.
The date format follows the standard HTTP date syntax. Precision depends on the archive: some services store daily snapshots, others capture pages multiple times per day.
Values
HTTP-date
An IMF-fixdate timestamp specifying the preferred
point in time. The format follows
Day, DD Mon YYYY HH:MM:SS GMT.
Example
A client requesting a snapshot of a resource from January 2015. The date follows the required IMF-fixdate format with a GMT timezone.
Accept-Datetime: Thu, 15 Jan 2015 00:00:00 GMT
A full request to a TimeGate, asking for the version of a page archived closest to July 2020.
GET /web/https://example.re/ HTTP/1.1
Host: web.archive.org
Accept-Datetime: Wed, 01 Jul 2020 12:00:00 GMT
The server responds with a redirect pointing at the closest available Memento.
HTTP/1.1 302 Found
Location: /web/20200701115548/https://example.re/
Link: <https://example.re/>; rel="original", </web/20200701115548/https://example.re/>; rel="memento"; datetime="Wed, 01 Jul 2020 11:55:48 GMT", </web/timemap/link/https://example.re/>; rel="timemap"; type="application/link-format"
Vary: Accept-Datetime
The 14-digit path segment is the capture timestamp down to the second. The Link header carries three members: the original resource, the selected Memento with its capture datetime, and the TimeMap listing every capture the archive holds for the page.
Following the redirect returns the Memento itself with 200 OK and the Memento-Datetime header naming the capture date.
See also
- RFC 7089: HTTP Framework for Time-Based Access to Resource States -- Memento
- Memento-Datetime
- Content negotiation
- HTTP headers