Let’s say you’re browsing around on the Internet for sources and you come across a fantastic article. Everything’s there, except for one crucial component. The date of the article is missing.

Now what, abandon ship? No, do an HTTP Header check!

What?? Basically when your device accesses the Internet, you send it request headers, and the server sends you back response headers. Headers comprise the information that gets sent first, before your browser receives the actual website content. You, as the casual reader, won’t see any of these, as its handled internally by the browser itself. Among some of the headers that may be sent:

  • Content-Length: The size of the response body
  • Content-Type: The MIME type of the content (e.g. video, audio, HTML)
  • Last-Modified: The date at which the document was last modified
  • Set-Cookie: Any cookies that the browser needs to be set.

Notice the presence of the last-modified header, which will tell you when the document on the server was last changed. The value of Last-Modified is not necessarily when the document was created, but rather when it was last edited. Not all servers send Last-Modified information, but those who do will often specify the time up to the second. Perfect for bibliographies!

How to get Last-Modified information

Fortunately, you don’t have to know any code to do this! Visit one of the websites below, type in the website of the resource, and look for a “Last-Modified” header.

For example, entering the URL http://cs.stanford.edu/people/eroberts/cs181/projects/2010-11/NetNeutrality/Articles/CaseStudies.html into the first one retrieves the following:

HTTP 200  OK
Date: Sun, 11 May 2014 23:52:30 GMT
Server: Apache/2.2.3 (CentOS)
Last-modified: Fri, 03 Jun 2011 22:02:30 GMT
Etag: "63497a72-1dff-4a4d5e8f1e980"
Accept-ranges: bytes
Content-length: 7679
Connection: close
Content-type: text/html; charset=UTF-8

If there is no Last-Modified header, then the server has decided not to send said information. But still, worth a try!

Published by Geoffrey Liu

A software engineer by trade and a classical musician at heart. Currently a software engineer at Groupon getting into iOS mobile development. Recently graduated from the University of Washington, with a degree in Computer Science and a minor in Music. Web development has been my passion for many years. I am also greatly interested in UI/UX design, teaching, cooking, biking, and collecting posters.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.