Solved

About If-Modified-Since

Posted on 2007-03-19
4
446 Views
Last Modified: 2010-04-20
I type in the following in command prompt
telnet www.google.com 80

and type the following as the request html header
GET / HTTP/1.1
Host: www.google.com
If-Modified-Since: Mon, 19 Mar 2007 02:43:31 GMT

and sent, but it always return me http/1.1 200 OK and the entire webpage.  

Is my syntax correct? Can somebody give me an example that will return http/1.1 304 modified with the correct syntax?
0
Comment
Question by:william007
  • 2
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
JamesCssl earned 500 total points
ID: 18754494
GET / HTTP/1.1
Host: www.cyberpear.com
If-Modified-Since: Sun, 17 Dec 2006 21:52:08 GMT



You should note that you will only get a 304 response from a page that sends a last-modified header or an ETag header.  Google doesn't do this.  Also, your timestamp has to be the exact same as the last-modified timestamp to receive the 304.

To receive a 304 from an ETag, use the If-None-Match header.
0
 
LVL 9

Author Comment

by:william007
ID: 18765647
Thanks, Your example is working great:)

But if I try to send
GET / HTTP/1.1
Host: www.cyberpear.com
If-Modified-Since: Wed, 21 Mar 2007 02:43:31 GMT

Again it gives me http/1.1 200 OK. 21 Mar 2007 is later than 17 Dec 2006, but why doesn't give me the same result?
Also, how do you know what date to put there?

I am trying to write a proxy server that check the pages in its cache whether has been modified, hence I need to understand these things in details.
0
 
LVL 9

Author Comment

by:william007
ID: 18765689
Also I discover that, for the images, it will always give me the same result, ie 304 not modified even I put different date, again, what is the reason?

GET http://www.new-dream.de/image/wallpaper/computer/apple/apple_14.jpg HTTP/1.1
Host: www.new-dream.de
If-Modified-Since: Wed, 20 Mar 2007 02:43:31 GMT

GET http://www.new-dream.de/image/wallpaper/computer/apple/apple_14.jpg HTTP/1.1
Host: www.new-dream.de
If-Modified-Since: Wed, 20 Feb 2007 02:43:31 GMT
0
 
LVL 11

Assisted Solution

by:JamesCssl
JamesCssl earned 500 total points
ID: 18767103
Some implementations of If-Modified-Since only check to see if the date in the If-Modified-Since header is exactly the same as the file modification date.  The W3C does it correctly (checking if the date is the same or later than the modification date:

GET / HTTP/1.1
Host: www.w3.org
If-Modified-Since: Wed, 21 Mar 2007 18:40:11 GMT
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now