tags:

views:

61

answers:

1

i downloaded a web page ".html" on mu hard disk i would like to check if this page has been updated recently without downloading the page again.. P.S. when i use last-modified it doesn't work on some servers Can anyone help me?? thanks in advance

+1  A: 

If last-modified doesnt work you cant really check. However you can fudge it by checking the content length if the content length is always the same unless updated. I assume you already know you can use the HEAD method to check a page without getting the content.

acidzombie24
thanks,but sorry,do you mean header["content-lenght"],as far i know it also need to download the page again
Eng.Mohamed
It doesnt matter which language but that should work. I use response.ContentLength; response is = (HttpWebResponse)request.GetResponse()). request is a HttpWebRequest
acidzombie24
yes, but getresponse need to download the page which i don't want
Eng.Mohamed
Not if you use HttpMethod = "HEAD". Then it gets the header which tells you the content length ;) -edit- After fixing one of my apps i used HEAD to check for the content length of many zip files. It finished in seconds. There were dozens of zips that were > 100mb large.
acidzombie24