def updateCache(self, service, url, new_data, new_data_dt):
key = self._get_key(service, url)<EOL>try:<EOL><INDENT>value = self.client.get(key)<EOL>if value:<EOL><INDENT>data = pickle.loads(value, encoding="<STR_LIT:utf8>")<EOL>if "<STR_LIT>" in data:<EOL><INDENT>cached_data_dt = parse(data["<STR_LIT>"])<EOL>if new_data_dt > cached_data_dt:<EOL><INDENT>self.client.delete(key)<EOL>logger.info(<EOL>"<STR_LIT>".format(key))<EOL><DEDENT>else:<EOL><INDENT>logger.info(<EOL>"<STR_LIT>".format(key))<EOL>return<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>logger.info("<STR_LIT>".format(key))<EOL><DEDENT><DEDENT>except MemcachedException as ex:<EOL><INDENT>logger.error(<EOL>"<STR_LIT>".format(key, str(ex)))<EOL>return<EOL><DEDENT>cdata, time_to_store = self._make_cache_data(<EOL>service, url, new_data, {}, <NUM_LIT:200>, new_data_dt)<EOL>self.client.set(key, cdata, time=time_to_store)<EOL>logger.info(<EOL>"<STR_LIT>".format(<EOL>key, time_to_store))<EOL>
:param new_data: a string representation of the data
:param new_data_dt: a timezone aware datetime object giving
        the timestamp of the new_data
:raise MemcachedException: if update failed