'gets the length of time an item should remain in the local cache
before being evicted
note that previous values are calculated and stored since this method
is used on every cache read'

@classmethod
def _get_cache_life_span(cls):

    def __parse_life_span_string():
        try:
            return long(life_span_string)
        except ValueError:
            try:
                (d, h, m, s) = TIME_RE.match(life_span_string).groups()
                times = [(s, 1), (m, 60), (h, 3600), (d, 86400)]
                return sum(((long((t[0] or 0)) * t[1]) for t in times))
            except:
                print 'error    parsing    life_span_string    {0}'.format(life_span_string)
                traceback.print_exc()
                return 1800
    with cls._LIFE_SPAN_LOCK:
        life_span_string = get_setting('local_cache_life_span')
        try:
            if (cls._PREV_LIFE_SPAN_STR == life_span_string):
                return cls._PREV_LIFE_SPAN
        except AttributeError:
            pass
        cls._PREV_LIFE_SPAN_STR = life_span_string
        cls._PREV_LIFE_SPAN = life_span = __parse_life_span_string()
        return life_span
