Page 1 of 1

HTTP header info.

Posted: Thu Apr 19, 2001 4:02 pm
by philip0
I am looking or a way to get the Last-Modified date from a web server without fetching the whole page.

I was thinking about doing something like this
<urlcp "maxpgsize" "10k">
<fetch http://website.com/somepage.html>
<urlinfo header "Last-Modified">

Does anyone have a better Idea ?

HTTP header info.

Posted: Fri Apr 20, 2001 7:33 am
by bart
That'll probably do it. I don't think you need to get 10K though, 1 or 2 should do it.

HTTP header info.

Posted: Fri Apr 20, 2001 9:56 am
by John
Another option is to use <SUBMIT METHOD=HEAD> to just get the headers, and then find the Last-Modified. Depending on what you are doing you might find <urlcp ifmodsince> useful.

HTTP header info.

Posted: Fri Apr 20, 2001 11:59 am
by Kai
Also, the <SUBMIT METHOD=HEAD> method is faster and more polite; a short-maxpgsize <fetch> still has to get some content, and then abruptly close the connection, probably generating an error in the remote server's error log.