Make Cache expiration check more flexible