'Checks whether the page is already cached and returns the cached
version if available.'

def process_request(self, request):

    if (not (request.method in ('GET', 'HEAD'))):
        request._cache_update_cache = False
        return None
    cache_key = get_cache_key(request, self.key_prefix, 'GET', cache=self.cache)
    if (cache_key is None):
        request._cache_update_cache = True
        return None
    response = self.cache.get(cache_key, None)
    if ((response is None) and (request.method == 'HEAD')):
        cache_key = get_cache_key(request, self.key_prefix, 'HEAD', cache=self.cache)
        response = self.cache.get(cache_key, None)
    if (response is None):
        request._cache_update_cache = True
        return None
    request._cache_update_cache = False
    return response
