human
Complete this python program:
def doc_page_cache(view):
assistant
#Here is the Python program you requested.

    """Decorator that caches the document page HTML.
    """
    @wraps(view)
    def _doc_page_cache_view(request, document_slug, *args, **kwargs):
        if (request.user.is_authenticated() or (request.GET.get('redirect') == 'no')):
            statsd.incr('wiki.document_view.cache.skip')
            return view(request, document_slug, *args, **kwargs)
        cache_key = doc_html_cache_key(mobile=request.MOBILE, locale=request.LANGUAGE_CODE, slug=document_slug, minimal=request.GET.get('minimal', '0'))
        (html, headers) = cache.get(cache_key, (None, None))
        if (html is not None):
            statsd.incr('wiki.document_view.cache.hit')
            res = HttpResponse(html)
            for (key, val) in headers.items():
                res[key] = val
            return res
        statsd.incr('wiki.document_view.cache.miss')
        response = view(request, document_slug, *args, **kwargs)
        if (response.status_code == 200):
            cache.set(cache_key, (response.content, dict(response._headers.values())))
        return response
    return _doc_page_cache_view