better handling of cache expiration