'Remove attributes from the response that shouldn\'t be cached.'

def __getstate__(self):

    state = super(Response, self).__getstate__()
    for key in (u'accepted_renderer', u'renderer_context', u'resolver_match', u'client', u'request', u'json', u'wsgi_request'):
        if (key in state):
            del state[key]
    state[u'_closable_objects'] = []
    return state
