'Sets the given request cache entries. If the new cache value is **None**
then it is removed from our cache.
:param dict params: **dict** of \'cache_key => value\' pairs to be cached
:param str namespace: namespace for the keys'

def _set_cache(self, params, namespace=None):

    with self._cache_lock:
        if (not self.is_caching_enabled()):
            return
        for (key, value) in list(params.items()):
            if namespace:
                cache_key = ('%s.%s' % (namespace, key))
            else:
                cache_key = key
            if (value is None):
                if (cache_key in self._request_cache):
                    del self._request_cache[cache_key]
            else:
                self._request_cache[cache_key] = value
