Fix modification-time cache invalidation

/cc @hampelm