GitHub PullRequestReviewCommentEvent at 2014-04-22 17:12:23
Repository: kitsune
Actor: rlr
Payload: {"comment":{"url":"https://api.github.com/repos/mozilla/kitsune/pulls/comments/11864228","id":11864228,"diff_hunk":"@@ -50,10 +51,42 @@\n log = logging.getLogger('k.wiki')\n \n \n+def doc_page_cache():\n+    \"\"\"Decorator that caches the document page HTML.\"\"\"\n+    def _doc_page_cache(view):\n+        def _doc_page_cache_view(request, document_slug, *args, **kwargs):\n+            # We skip caching for authed users or if redirect=no\n+            # is in the query string.\n+            if (request.user.is_authenticated() or\n+                    request.GET.get('redirect') == 'no'):\n+                return view(request, document_slug, *args, **kwargs)\n+\n+            cache_key = DOC_HTML_CACHE_KEY.format(\n+                mobile=request.MOBILE,\n+                locale=request.LANGUAGE_CODE,\n+                slug=document_slug)\n+            cache_key = hashlib.sha1(cache_key).hexdigest()\n+            html = cache.get(cache_key)\n+            if html is not None:\n+                return HttpResponse(html)","path":"kitsune/wiki/views.py","position":53,"original_position":53,"commit_id":"959c7a63cae4ee4ea5e81426d9be3b7bc3ec0ab6","original_commit_id":"959c7a63cae4ee4ea5e81426d9be3b7bc3ec0ab6","user":{"login":"rlr","id":36629,"avatar_url":"https://avatars.githubusercontent.com/u/36629?","gravatar_id":"00e30f0c3219349c80f3ff7aacc9d34a","url":"https://api.github.com/users/rlr","html_url":"https://github.com/rlr","followers_url":"https://api.github.com/users/rlr/followers","following_url":"https://api.github.com/users/rlr/following{/other_user}","gists_url":"https://api.github.com/users/rlr/gists{/gist_id}","starred_url":"https://api.github.com/users/rlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlr/subscriptions","organizations_url":"https://api.github.com/users/rlr/orgs","repos_url":"https://api.github.com/users/rlr/repos","events_url":"https://api.github.com/users/rlr/events{/privacy}","received_events_url":"https://api.github.com/users/rlr/received_events","type":"User","site_admin":false},"body":"YES! I was thinking about that this morning and forgot to write it down. Thanks for the reminder!","created_at":"2014-04-22T17:12:23Z","updated_at":"2014-04-22T17:12:23Z","html_url":"https://github.com/mozilla/kitsune/pull/1915#discussion_r11864228","pull_request_url":"https://api.github.com/repos/mozilla/kitsune/pulls/1915","_links":{"self":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/comments/11864228"},"html":{"href":"https://github.com/mozilla/kitsune/pull/1915#discussion_r11864228"},"pull_request":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/1915"}}}}