def _cached_path_needs_update(ca_path, cache_length):
exists = os.path.exists(ca_path)<EOL>if not exists:<EOL><INDENT>return True<EOL><DEDENT>stats = os.stat(ca_path)<EOL>if stats.st_mtime < time.time() - cache_length * <NUM_LIT> * <NUM_LIT>:<EOL><INDENT>return True<EOL><DEDENT>if stats.st_size == <NUM_LIT:0>:<EOL><INDENT>return True<EOL><DEDENT>return False<EOL>
Checks to see if a cache file needs to be refreshed

:param ca_path:
    A unicode string of the path to the cache file

:param cache_length:
    An integer representing the number of hours the cache is valid for

:return:
    A boolean - True if the cache needs to be updated, False if the file
    is up-to-date