Backend: doc: cache the status 'is_new', and take it into account when comparing documents

Signed-off-by: Jerome Flesch <jflesch@gmail.com>