Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a website that is automatically regenerated every day based on a fresh copy of an externally-supplied database, which has no concept of the modification time of the individual records (e.g., OpenBSD ports), and I'm thinking that perhaps there is some way to automatically keep track of the last modification time of all files based on a SHA-1 signature, or something similar?

The primary need of this modification time is to ensure that an XML sitemap could include such data, and thus alert Google et al. of which pages may have changed, and which have not, in order to optimize crawling.

share|improve this question

I don't know of a specific tool to do that. However, and since you write the generator, you could work out a simple process where you (1) generate the page and (2) copy the resulting page to where it goes only if it changed. This is assuming your generator creates the page the exact same way every time (i.e. you do not add a creation date & time in your documents.)


generate /tmp/page-123
if ! cmp /tmp/page-123 $WEBSITE_PATH/page-123
  cp /tmp/page-123 $WEBSITE_PATH/page-123

Then your other tools can make use of the modification time of the file under $WEBSITE_PATH since it won't change when the new database comes in.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.