Solved

About If-Modified-Since

Posted on 2007-03-19
4
452 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Specific format 21 198
Grunt No Clean Targets 6 157
WEB Farm 6 70
What language/protocol is the Angular Chat? 2 77
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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…

809 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