I think this may affect performance because we have two tests of `source.empty` per iteration. Unfortunately I don't see an easy way out of this. One possibility would be to add an enum:

```D
enum State { cached, staleCache, done }`
```

and then store such a value as part of `Cache` and update it appropriately. But then management of _that_ guy will have its own overhead.