def METHOD_NAME(cache_name, zoom_level, x, y, decoded_data):
    file_path = _get_cache_entry_path(cache_name=cache_name, zoom_level=zoom_level, x=x, y=y)
    if not os.path.isfile(file_path):
        if not decoded_data:
            warn("Trying to cache a tile without data: {}: {},{},{}", cache_name, zoom_level, x, y)
        else:
            try:
                directory = os.path.dirname(file_path)
                if not os.path.isdir(directory):
                    os.makedirs(directory)
                with open(file_path, "wb") as f:
                    pickle.dump(decoded_data, f, protocol=pickle.HIGHEST_PROTOCOL)
            except:
                critical("Error during caching of '{}': {}", file_path, sys.exc_info()[1])