def METHOD_NAME(self):
    """determine how long the cache should be"""
    trim_len = self.get_trim_len()
    # give a buffer of 64 steps since a span might increase
    # in future updates
    return min(self._max_span, self._max_span - trim_len + 64)