The mimetype is only required if all the other checks pass, i.e. when
the file has been modified or added.
It is beneficial to swap the order of timestamp and mimetype checks, as
the mimetype determination is much more expensive than the timestamp
retrieval, and the mimetype filter will only reject files occasionally
while the mtime filter will reject files most of the times.
Skip the mimetype determination for directories which would return
wrong results anyway, either "application/octet-stream" or even
"text/plain" for a directory named "test.log".