Fix our caching logic to be more strict.

Our caching logic took the Last Modified time over ETags, but this meant
that if ETags differed but Last Modified was the same, the cached
version would be considered good. We now take both into account when
checking cache validity.