How to check whether a page has been updated without downloading the entire webpage in Php? Whether I need to look in at the header?
How to check whether a page has been updated without downloading the entire webpage
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One possibility is to check the LastModified header. You can download just the headers by issuing a HEAD request. The server responds back with the HTTP headers only and you can inspect the last modified header and/or the content length header to detect changes.
One thing to note is that the HTTP server does not need to send this header so this would not work in all cases. The PHP function
get_headerswill fetch these for you.