Solved

About If-Modified-Since

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
jQuery Date picker not working 16 77
SSL sertificate 5 49
spamming  on Hosted svrs? 6 50
Problem to picture file 3 42
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.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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…

743 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

11 Experts available now in Live!

Get 1:1 Help Now