Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if data from a url has changed since last time?

Tags:

http

For a given URL, I want to check if the content has changed since the last time. The content for the (http) URL is generated by a script which goes through several modifications regularly. Need to see if there are any regressions caused by this changing of the script.

Prac

like image 225
maverickprac Avatar asked Dec 13 '22 00:12

maverickprac


1 Answers

Barring knowing what language you're using, the simplest solution is to format your request using the If-Modified-Since HTTP header and check for a 304 (not modified) response from your server. If the content is a static file generated by a script, then your webserver will check against the modified timestamp on the file. You'll either get a 304 response, or a 200 (OK) response with the new content page.

like image 99
WarrenB Avatar answered Dec 18 '22 11:12

WarrenB