def METHOD_NAME(key, ttl_sec, work_func):
    """Attempts to return value by key, otherwise caches and returns `work_func`"""
    redis = redis_connection.get_redis()
    cached_value = get_json_cached_key(redis, key)
    if cached_value:
        return cached_value
    to_cache = work_func()
    set_json_cached_key(redis, key, to_cache, ttl_sec)
    return to_cache