?
Solved

How to know if a web page's last update time

Posted on 2011-02-17
8
Medium Priority
?
284 Views
Last Modified: 2012-05-11
Hi,

As noted above, I want to use Java to detect a web page's last update time via httpresponse, etc. I don't want to save the web page's contents and verify through the contents.

Thanks
0
Comment
Question by:wsyy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 92

Expert Comment

by:objects
ID: 34922538
check the Last-Modified value in the http response header
0
 
LVL 92

Assisted Solution

by:objects
objects earned 164 total points
ID: 34922550
theres some code here that shows how to access the headers

http://helpdesk.objects.com.au/java/how-do-i-get-the-cookies-from-a-http-connection

If you just want the one value you can use

long lastModified = urlconnection.getLastModified();
0
 

Author Comment

by:wsyy
ID: 34923452
what if the header doesn't include the info? are there any other ways?
0
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
LVL 92

Expert Comment

by:objects
ID: 34923472
not unless they including it some other custom header
0
 
LVL 2

Accepted Solution

by:
calboronster earned 168 total points
ID: 34924969
As a caution comment, not a very good idea to detect browser time and take action because :

1. Browser time can be tampered by the end user.
2. There could be a real time difference between server and the client.

The best way is for the server to set a session token in response which can then be traced back in next responses and compared each time by the server for last access time (for that session token).
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 168 total points
ID: 34924978
You can generally only do that if the web page is a static file unless the site has some other means of announcing it.

It's worth checking if the If-Modified-Since header is set though - some sites implement this
0
 

Author Comment

by:wsyy
ID: 34925943
calboronster:

My crawling application wants to detect the changes of a web page ever since last crawl. The solution you provided seems that a good check can be done only on the server side which may not help my case.

Thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 34971137
>>The solution you provided seems that a good check can be done only on the server side which may not help my case.

I wonder why you accepted it then?
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

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