cache: put by-date/ entries in direntry cache
Since those entries are updated in the background, we invalidate the
cache on a regular basis.
Close T2864. This should also fix the second problem of T2830, namely
the fact that get_entries(by_date, offset) was not reliable because of
the offset supposing the entries were the same every time.