문제

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,

도움이 되었습니까?

해결책 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

다른 팁

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)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top