in reply to Re^4: Last Modified for Template file
in thread Last Modified for Template file
I think your best bet would be to handle it in the server. Call out to Template, build the complete bytes of the body, then hash them (md5 or sha1) and save that somewhere (database, textfile) and if it doesn't match the previous value for this URL, update the timestamp.Then add the header the way it was meant to be added - as a header.
Edit: just saw your comment about "to process with a static site generator". In that case, in the step where you generate the pages from templates, you could just render to memory first, hash it, and only overwrite the file on disk if the content has changed. Your static site generator should then be able to get the last-modified from the mtime of the pages.
|
|---|