Ensure the cache is invalidated if the date has changed

This does involve an extra `substr` call, but should not have a noticeable impact on performance.

Should fix #168