'On a 304 we will get a new set of headers that we want to
update our cached value with, assuming we have one.
This should only ever be called when we\'ve sent an ETag and
gotten a 304 as the response.'

def update_cached_response(self, request, response):

    cache_url = self.cache_url(request.url)
    cached_response = self.serializer.loads(request, self.cache.get(cache_url))
    if (not cached_response):
        return response
    excluded_headers = ['content-length']
    cached_response.headers.update(dict(((k, v) for (k, v) in response.headers.items() if (k.lower() not in excluded_headers))))
    cached_response.status = 200
    self.cache.set(cache_url, self.serializer.dumps(request, cached_response))
    return cached_response
