Backport TransientCache expiration to 1.6.x

Backport of #267, fixes #264 and #265.

Contained to the TransientCache class, and a few calls to its constructor.  Old constructor signature still available so it shouldn't break anything.