{"action":"created","issue":{"url":"https://api.github.com/repos/canonical-websites/insights.ubuntu.com/issues/153","repository_url":"https://api.github.com/repos/canonical-websites/insights.ubuntu.com","labels_url":"https://api.github.com/repos/canonical-websites/insights.ubuntu.com/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/canonical-websites/insights.ubuntu.com/issues/153/comments","events_url":"https://api.github.com/repos/canonical-websites/insights.ubuntu.com/issues/153/events","html_url":"https://github.com/canonical-websites/insights.ubuntu.com/pull/153","id":293359849,"number":153,"title":"Fix and simplify cache","user":{"login":"nottrobin","id":519935,"avatar_url":"https://avatars2.githubusercontent.com/u/519935?v=4","gravatar_id":"","url":"https://api.github.com/users/nottrobin","html_url":"https://github.com/nottrobin","followers_url":"https://api.github.com/users/nottrobin/followers","following_url":"https://api.github.com/users/nottrobin/following{/other_user}","gists_url":"https://api.github.com/users/nottrobin/gists{/gist_id}","starred_url":"https://api.github.com/users/nottrobin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nottrobin/subscriptions","organizations_url":"https://api.github.com/users/nottrobin/orgs","repos_url":"https://api.github.com/users/nottrobin/repos","events_url":"https://api.github.com/users/nottrobin/events{/privacy}","received_events_url":"https://api.github.com/users/nottrobin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-01T00:17:31Z","updated_at":"2018-02-01T00:20:32Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/canonical-websites/insights.ubuntu.com/pulls/153","html_url":"https://github.com/canonical-websites/insights.ubuntu.com/pull/153","diff_url":"https://github.com/canonical-websites/insights.ubuntu.com/pull/153.diff","patch_url":"https://github.com/canonical-websites/insights.ubuntu.com/pull/153.patch"},"body":"Massively simplify the caching. There's now no way to tell if we got a cached response because of an error behind the scenes, but we weren't using that anyway, and at least now the cache works.\r\n\r\nQA\r\n--\r\n\r\nRemove cache and run the server in the background\r\n\r\n``` bash\r\n$ rm -f cache.sqlite    # Delete cache\r\n$ ./run serve --detach  # Run server in background\r\n```\r\n\r\nNow time the first request:\r\n\r\n``` bash\r\n$ time curl -s http://127.0.0.1:8023 > /dev/null\r\n\r\nreal    0m2.036s\r\nuser    0m0.020s\r\nsys     0m0.004s\r\n```\r\n\r\nThis should take a couple of seconds. Now try a couple more times - these should take less than a second:\r\n\r\n``` bash\r\n$ time curl -sq http://127.0.0.1:8023 > /dev/null\r\n\r\nreal    0m0.182s\r\nuser    0m0.008s\r\nsys     0m0.008s\r\n\r\n$ time curl -sq http://127.0.0.1:8023 > /dev/null\r\n\r\nreal    0m0.188s\r\nuser    0m0.008s\r\nsys     0m0.008s\r\n```\r\n\r\nStop the server:\r\n\r\n``` bash\r\n$ ./run stop\r\n```"},"comment":{"url":"https://api.github.com/repos/canonical-websites/insights.ubuntu.com/issues/comments/362115895","html_url":"https://github.com/canonical-websites/insights.ubuntu.com/pull/153#issuecomment-362115895","issue_url":"https://api.github.com/repos/canonical-websites/insights.ubuntu.com/issues/153","id":362115895,"user":{"login":"webteam-app","id":11771828,"avatar_url":"https://avatars0.githubusercontent.com/u/11771828?v=4","gravatar_id":"","url":"https://api.github.com/users/webteam-app","html_url":"https://github.com/webteam-app","followers_url":"https://api.github.com/users/webteam-app/followers","following_url":"https://api.github.com/users/webteam-app/following{/other_user}","gists_url":"https://api.github.com/users/webteam-app/gists{/gist_id}","starred_url":"https://api.github.com/users/webteam-app/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webteam-app/subscriptions","organizations_url":"https://api.github.com/users/webteam-app/orgs","repos_url":"https://api.github.com/users/webteam-app/repos","events_url":"https://api.github.com/users/webteam-app/events{/privacy}","received_events_url":"https://api.github.com/users/webteam-app/received_events","type":"User","site_admin":false},"created_at":"2018-02-01T00:20:32Z","updated_at":"2018-02-01T00:20:32Z","author_association":"NONE","body":"Starting demo at: http://insights.ubuntu.com-pr-153.run.demo.haus/"}}
{"actor":{"display_login":"webteam-app"}}