Skip to content

Instantly share code, notes, and snippets.

@ivan
Last active April 11, 2023 14:41
Show Gist options
  • Save ivan/07436859fa4f77c089a0f500343ef4db to your computer and use it in GitHub Desktop.
Save ivan/07436859fa4f77c089a0f500343ef4db to your computer and use it in GitHub Desktop.
A less naïve perception of URLs

Ordinarily, when we encounter a URL, we take just the URL by itself and do something with it; perhaps we try to load it in our browser or store it somewhere.

We can consider this to be the more naïve interpretation of a URL: we assume we're always fine with the latest version of the document, or the document is unchanging, or the changes don't really matter; we try to load the URL in our browser and if the website is gone or not the version we expect, well, tough luck for us.

But we can make our perception of URLs a little less naïve, as there is another piece of data we can take when we see a URL: the time that the URL was posted. Fortunately, we typically encounter URLs in documents or messages with some sort of timestamp.

So instead of taking URL, we take (URL, referring_document_time), which enables us to know which version of the document that author was referring to. We can then, for example, look up that website around that point in time in Wayback Machine. In other cases, when a website partially preserves its own history (e.g. GitHub, Wikipedia), we may not need a third-party archive if we can ask the website itself for an older version of the document.

This is not a new idea and has been implemented in various place:

  1. When following links in Wayback Machine, you get a snapshot of the target page that is closest in time to the linking page.
  2. With the Refined GitHub extension, when following a link from a GitHub issue to a file, e.g. rust-lang/rust-analyzer#14474 (comment) -> https://github.com/ludios/rust-analyzer-issue-14474-repro/blob/master/src/main.rs?rgh-link-date=2023-04-09T10%3A11%3A13Z, the extension offers: "You can also view this object as it appeared at the time of the comment (2 days ago)", and this links you to a particular commit.

    (This feature is mplemented in comments-time-machine-links.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment