'Sets the cache, if needed.'

def process_response(self, request, response):

    if (not self._should_update_cache(request, response)):
        return response
    if (request.method != 'GET'):
        return response
    if (not (response.status_code == 200)):
        return response
    timeout = get_max_age(response)
    if (timeout == None):
        timeout = self.cache_timeout
    elif (timeout == 0):
        return response
    patch_response_headers(response, timeout)
    if timeout:
        cache_key = learn_cache_key(request, response, timeout, self.key_prefix)
        cache.set(cache_key, response, timeout)
    return response
