The If-Modified-Since HTTP Header

The “If-Modified-Since” HTTP header is sent from an agent (browser/bot) to the web server in order to know if the requested page has been changed since its last visit. The server responds with a 200 code (Ok) if the page has been modified or with a 304 code (Not modified) if the page has not been modified.

Here is an easy way to check if a web server supports the if-modified-since HTTP header:

Telnet the web site on port 80:

# telnet www.example.com 80

Then enter the following (modify it according to your requested web site) :

GET /index.html HTTP/1.0
User-Agent: Mozilla/5.0
From: something.somewhere.net
Accept: text/html,text/plain,application/*
Host: www.example.com
If-Modified-Since: Wed, 19 Oct 2005 10:50:00 GMT

I assume that you know what is the last modification time of the web page, so substitute the date and time to something later than that. Just remember to use GMT time.

If the returned code is 304 (Not modified), then the server supports this header.

The If-Modified-Since HTTP Header by George Notaras is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Copyright © 2005 - Some Rights Reserved

George Notaras avatar

About George Notaras

George Notaras is the editor of the G-Loaded Journal, a technical blog about Free and Open-Source Software. George, among other things, is an enthusiast self-taught GNU/Linux system administrator. He has created this web site to share the IT knowledge and experience he has gained over the years with other people. George primarily uses CentOS and Fedora. He has also developed some open-source software projects in his spare time.