Question

i have a question for checking : "is page content changed?". etag is very good solution but i want to checking any url if developer of web page used etag or not. and i dont want to download full page before if it is not changed. it is possible static file with last-modified meta via curl but it is not possible on dynamic page if developer didn't use etag or any method.

i dont want to use md5(file_get_content("http://..")) or same way.

solution must like curl --head http://.... | grep ..| awk ..

sorry for language, Thanks,

Was it helpful?

Solution 2

Using HTTP, the last-modified header is the only chance to check that a file or a dynamic page has been updated without downloading the whole resource. If the developer don't cares about that header then there is no chance

OTHER TIPS

Agree and MD5 is probably the best option, but you can improve on your method, no need for file_get_content just use:

md5_file("http://..")

(see: http://www.php.net/manual/en/function.md5-file.php)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top