Ensure we invalidate the cache if the date has changed

This does involve an extra `substr` call, but should not have a noticeable impact on performance.
Merge pull request #169 from mhart/patch-1

Ensure the cache is invalidated if the date has changed