conditional cache expiration