{"action":"closed","number":351,"pull_request":{"url":"https://api.github.com/repos/hr-dash/hr-dash/pulls/351","id":91621980,"html_url":"https://github.com/hr-dash/hr-dash/pull/351","diff_url":"https://github.com/hr-dash/hr-dash/pull/351.diff","patch_url":"https://github.com/hr-dash/hr-dash/pull/351.patch","issue_url":"https://api.github.com/repos/hr-dash/hr-dash/issues/351","number":351,"state":"closed","locked":false,"title":"Dev/346 cache user profile","user":{"login":"ta-chibana","id":12688123,"avatar_url":"https://avatars.githubusercontent.com/u/12688123?v=3","gravatar_id":"","url":"https://api.github.com/users/ta-chibana","html_url":"https://github.com/ta-chibana","followers_url":"https://api.github.com/users/ta-chibana/followers","following_url":"https://api.github.com/users/ta-chibana/following{/other_user}","gists_url":"https://api.github.com/users/ta-chibana/gists{/gist_id}","starred_url":"https://api.github.com/users/ta-chibana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ta-chibana/subscriptions","organizations_url":"https://api.github.com/users/ta-chibana/orgs","repos_url":"https://api.github.com/users/ta-chibana/repos","events_url":"https://api.github.com/users/ta-chibana/events{/privacy}","received_events_url":"https://api.github.com/users/ta-chibana/received_events","type":"User","site_admin":false},"body":"# 概要\r\nRedisにプロフィールをキャッシュするようにしてみた。\r\nそこまで大きく速度が変化するわけではなく、\r\n「こんな感じのコードでできるようです」といった意味合いで見やすいだろうと思ってプルリクあげました。\r\nなのでUserProfileのキャッシュは不要！とのことであればそのままcloseにしようかと思っています。\r\n\r\n- before  \r\n37.1ms + 3.1ms app/views/user_profiles/show.html.slim\r\n- after  \r\n4.9ms + 1.5ms app/views/user_profiles/show.html.slim\r\n\r\n相談したいことが2点あって、\r\n\r\n1. そもそもcache_storeはRedisで良いのか  \r\n個人的にはAWSでの運用であまりお金とか気にしなくて良さそう（？）な `ActiveSupport::Cache::MemoryStore` でも良いのかなと思っています。  \r\nAWS詳しくなく、かなり適当なのでどなたかご意見をいただければ...  \r\nただ、cache_sotre変更するだけであれば、そこまで手間ではない（ソースコードの変更だけであれば）と思うので、後から変更でも良いかなと思っています。\r\n2. キャッシュの有効期限どうするか  \r\nUserProfileだとそこまで変更あるとは思えないので、まだまだ長くとっても良いかなと思っています。\r\n\r\n# 再現・確認手順\r\n\r\n## 速度確認\r\n\r\n1. `.env` に以下を追記\r\nただし、すでにローカルでRedisを利用している方は **/0/** の部分に注意！\r\n**/1/** とか使ってないとこに変更すると良いはず。\r\n```\r\nREDIS_URL=redis://localhost:6379/0/cache\r\n```\r\n2. サーバー起動, Redis起動  \r\n  ```\r\n  $ bundle exec rails s\r\n  $ redis-server\r\n  ```\r\n3. [プロフィール画面](http://localhost:3000/user_profiles/125?lineprofiler=app)へアクセス\r\n4. リロード（初回でキャッシュさせる必要があるため）\r\n5. `app/views/user_profiles/show.html.slim` を確認\r\n\r\n## プロフィールの更新が反映されるか\r\n- `rails console` で\r\n\r\n# 対応Issue（任意）\r\n#346 \r\n\r\n# ToDo\r\n\r\n- [x] ラベル付け\r\n- [x] Assigneesで自分を選択\r\n","created_at":"2016-10-31T14:47:33Z","updated_at":"2016-12-04T14:41:17Z","closed_at":"2016-12-04T14:41:17Z","merged_at":null,"merge_commit_sha":"e5f7526a6aa488faf4c9b95effd37658f170c5bf","assignee":{"login":"ta-chibana","id":12688123,"avatar_url":"https://avatars.githubusercontent.com/u/12688123?v=3","gravatar_id":"","url":"https://api.github.com/users/ta-chibana","html_url":"https://github.com/ta-chibana","followers_url":"https://api.github.com/users/ta-chibana/followers","following_url":"https://api.github.com/users/ta-chibana/following{/other_user}","gists_url":"https://api.github.com/users/ta-chibana/gists{/gist_id}","starred_url":"https://api.github.com/users/ta-chibana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ta-chibana/subscriptions","organizations_url":"https://api.github.com/users/ta-chibana/orgs","repos_url":"https://api.github.com/users/ta-chibana/repos","events_url":"https://api.github.com/users/ta-chibana/events{/privacy}","received_events_url":"https://api.github.com/users/ta-chibana/received_events","type":"User","site_admin":false},"assignees":[{"login":"ta-chibana","id":12688123,"avatar_url":"https://avatars.githubusercontent.com/u/12688123?v=3","gravatar_id":"","url":"https://api.github.com/users/ta-chibana","html_url":"https://github.com/ta-chibana","followers_url":"https://api.github.com/users/ta-chibana/followers","following_url":"https://api.github.com/users/ta-chibana/following{/other_user}","gists_url":"https://api.github.com/users/ta-chibana/gists{/gist_id}","starred_url":"https://api.github.com/users/ta-chibana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ta-chibana/subscriptions","organizations_url":"https://api.github.com/users/ta-chibana/orgs","repos_url":"https://api.github.com/users/ta-chibana/repos","events_url":"https://api.github.com/users/ta-chibana/events{/privacy}","received_events_url":"https://api.github.com/users/ta-chibana/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/hr-dash/hr-dash/pulls/351/commits","review_comments_url":"https://api.github.com/repos/hr-dash/hr-dash/pulls/351/comments","review_comment_url":"https://api.github.com/repos/hr-dash/hr-dash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hr-dash/hr-dash/issues/351/comments","statuses_url":"https://api.github.com/repos/hr-dash/hr-dash/statuses/5f9ab8821aeecf6b10bdae62217ae8905f055157","head":{"label":"hr-dash:dev/346-cache-user-profile","ref":"dev/346-cache-user-profile","sha":"5f9ab8821aeecf6b10bdae62217ae8905f055157","user":{"login":"hr-dash","id":14330339,"avatar_url":"https://avatars.githubusercontent.com/u/14330339?v=3","gravatar_id":"","url":"https://api.github.com/users/hr-dash","html_url":"https://github.com/hr-dash","followers_url":"https://api.github.com/users/hr-dash/followers","following_url":"https://api.github.com/users/hr-dash/following{/other_user}","gists_url":"https://api.github.com/users/hr-dash/gists{/gist_id}","starred_url":"https://api.github.com/users/hr-dash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hr-dash/subscriptions","organizations_url":"https://api.github.com/users/hr-dash/orgs","repos_url":"https://api.github.com/users/hr-dash/repos","events_url":"https://api.github.com/users/hr-dash/events{/privacy}","received_events_url":"https://api.github.com/users/hr-dash/received_events","type":"Organization","site_admin":false},"repo":{"id":42654368,"name":"hr-dash","full_name":"hr-dash/hr-dash","owner":{"login":"hr-dash","id":14330339,"avatar_url":"https://avatars.githubusercontent.com/u/14330339?v=3","gravatar_id":"","url":"https://api.github.com/users/hr-dash","html_url":"https://github.com/hr-dash","followers_url":"https://api.github.com/users/hr-dash/followers","following_url":"https://api.github.com/users/hr-dash/following{/other_user}","gists_url":"https://api.github.com/users/hr-dash/gists{/gist_id}","starred_url":"https://api.github.com/users/hr-dash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hr-dash/subscriptions","organizations_url":"https://api.github.com/users/hr-dash/orgs","repos_url":"https://api.github.com/users/hr-dash/repos","events_url":"https://api.github.com/users/hr-dash/events{/privacy}","received_events_url":"https://api.github.com/users/hr-dash/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hr-dash/hr-dash","description":null,"fork":false,"url":"https://api.github.com/repos/hr-dash/hr-dash","forks_url":"https://api.github.com/repos/hr-dash/hr-dash/forks","keys_url":"https://api.github.com/repos/hr-dash/hr-dash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hr-dash/hr-dash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hr-dash/hr-dash/teams","hooks_url":"https://api.github.com/repos/hr-dash/hr-dash/hooks","issue_events_url":"https://api.github.com/repos/hr-dash/hr-dash/issues/events{/number}","events_url":"https://api.github.com/repos/hr-dash/hr-dash/events","assignees_url":"https://api.github.com/repos/hr-dash/hr-dash/assignees{/user}","branches_url":"https://api.github.com/repos/hr-dash/hr-dash/branches{/branch}","tags_url":"https://api.github.com/repos/hr-dash/hr-dash/tags","blobs_url":"https://api.github.com/repos/hr-dash/hr-dash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hr-dash/hr-dash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hr-dash/hr-dash/git/refs{/sha}","trees_url":"https://api.github.com/repos/hr-dash/hr-dash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hr-dash/hr-dash/statuses/{sha}","languages_url":"https://api.github.com/repos/hr-dash/hr-dash/languages","stargazers_url":"https://api.github.com/repos/hr-dash/hr-dash/stargazers","contributors_url":"https://api.github.com/repos/hr-dash/hr-dash/contributors","subscribers_url":"https://api.github.com/repos/hr-dash/hr-dash/subscribers","subscription_url":"https://api.github.com/repos/hr-dash/hr-dash/subscription","commits_url":"https://api.github.com/repos/hr-dash/hr-dash/commits{/sha}","git_commits_url":"https://api.github.com/repos/hr-dash/hr-dash/git/commits{/sha}","comments_url":"https://api.github.com/repos/hr-dash/hr-dash/comments{/number}","issue_comment_url":"https://api.github.com/repos/hr-dash/hr-dash/issues/comments{/number}","contents_url":"https://api.github.com/repos/hr-dash/hr-dash/contents/{+path}","compare_url":"https://api.github.com/repos/hr-dash/hr-dash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hr-dash/hr-dash/merges","archive_url":"https://api.github.com/repos/hr-dash/hr-dash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hr-dash/hr-dash/downloads","issues_url":"https://api.github.com/repos/hr-dash/hr-dash/issues{/number}","pulls_url":"https://api.github.com/repos/hr-dash/hr-dash/pulls{/number}","milestones_url":"https://api.github.com/repos/hr-dash/hr-dash/milestones{/number}","notifications_url":"https://api.github.com/repos/hr-dash/hr-dash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hr-dash/hr-dash/labels{/name}","releases_url":"https://api.github.com/repos/hr-dash/hr-dash/releases{/id}","deployments_url":"https://api.github.com/repos/hr-dash/hr-dash/deployments","created_at":"2015-09-17T12:15:06Z","updated_at":"2016-10-30T05:13:36Z","pushed_at":"2016-12-04T11:49:07Z","git_url":"git://github.com/hr-dash/hr-dash.git","ssh_url":"git@github.com:hr-dash/hr-dash.git","clone_url":"https://github.com/hr-dash/hr-dash.git","svn_url":"https://github.com/hr-dash/hr-dash","homepage":null,"size":1058,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":27,"forks":0,"open_issues":27,"watchers":1,"default_branch":"develop"}},"base":{"label":"hr-dash:develop","ref":"develop","sha":"943c3ebbb958a0d4b9fa6e3768cbd4f4dd42ac56","user":{"login":"hr-dash","id":14330339,"avatar_url":"https://avatars.githubusercontent.com/u/14330339?v=3","gravatar_id":"","url":"https://api.github.com/users/hr-dash","html_url":"https://github.com/hr-dash","followers_url":"https://api.github.com/users/hr-dash/followers","following_url":"https://api.github.com/users/hr-dash/following{/other_user}","gists_url":"https://api.github.com/users/hr-dash/gists{/gist_id}","starred_url":"https://api.github.com/users/hr-dash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hr-dash/subscriptions","organizations_url":"https://api.github.com/users/hr-dash/orgs","repos_url":"https://api.github.com/users/hr-dash/repos","events_url":"https://api.github.com/users/hr-dash/events{/privacy}","received_events_url":"https://api.github.com/users/hr-dash/received_events","type":"Organization","site_admin":false},"repo":{"id":42654368,"name":"hr-dash","full_name":"hr-dash/hr-dash","owner":{"login":"hr-dash","id":14330339,"avatar_url":"https://avatars.githubusercontent.com/u/14330339?v=3","gravatar_id":"","url":"https://api.github.com/users/hr-dash","html_url":"https://github.com/hr-dash","followers_url":"https://api.github.com/users/hr-dash/followers","following_url":"https://api.github.com/users/hr-dash/following{/other_user}","gists_url":"https://api.github.com/users/hr-dash/gists{/gist_id}","starred_url":"https://api.github.com/users/hr-dash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hr-dash/subscriptions","organizations_url":"https://api.github.com/users/hr-dash/orgs","repos_url":"https://api.github.com/users/hr-dash/repos","events_url":"https://api.github.com/users/hr-dash/events{/privacy}","received_events_url":"https://api.github.com/users/hr-dash/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hr-dash/hr-dash","description":null,"fork":false,"url":"https://api.github.com/repos/hr-dash/hr-dash","forks_url":"https://api.github.com/repos/hr-dash/hr-dash/forks","keys_url":"https://api.github.com/repos/hr-dash/hr-dash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hr-dash/hr-dash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hr-dash/hr-dash/teams","hooks_url":"https://api.github.com/repos/hr-dash/hr-dash/hooks","issue_events_url":"https://api.github.com/repos/hr-dash/hr-dash/issues/events{/number}","events_url":"https://api.github.com/repos/hr-dash/hr-dash/events","assignees_url":"https://api.github.com/repos/hr-dash/hr-dash/assignees{/user}","branches_url":"https://api.github.com/repos/hr-dash/hr-dash/branches{/branch}","tags_url":"https://api.github.com/repos/hr-dash/hr-dash/tags","blobs_url":"https://api.github.com/repos/hr-dash/hr-dash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hr-dash/hr-dash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hr-dash/hr-dash/git/refs{/sha}","trees_url":"https://api.github.com/repos/hr-dash/hr-dash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hr-dash/hr-dash/statuses/{sha}","languages_url":"https://api.github.com/repos/hr-dash/hr-dash/languages","stargazers_url":"https://api.github.com/repos/hr-dash/hr-dash/stargazers","contributors_url":"https://api.github.com/repos/hr-dash/hr-dash/contributors","subscribers_url":"https://api.github.com/repos/hr-dash/hr-dash/subscribers","subscription_url":"https://api.github.com/repos/hr-dash/hr-dash/subscription","commits_url":"https://api.github.com/repos/hr-dash/hr-dash/commits{/sha}","git_commits_url":"https://api.github.com/repos/hr-dash/hr-dash/git/commits{/sha}","comments_url":"https://api.github.com/repos/hr-dash/hr-dash/comments{/number}","issue_comment_url":"https://api.github.com/repos/hr-dash/hr-dash/issues/comments{/number}","contents_url":"https://api.github.com/repos/hr-dash/hr-dash/contents/{+path}","compare_url":"https://api.github.com/repos/hr-dash/hr-dash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hr-dash/hr-dash/merges","archive_url":"https://api.github.com/repos/hr-dash/hr-dash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hr-dash/hr-dash/downloads","issues_url":"https://api.github.com/repos/hr-dash/hr-dash/issues{/number}","pulls_url":"https://api.github.com/repos/hr-dash/hr-dash/pulls{/number}","milestones_url":"https://api.github.com/repos/hr-dash/hr-dash/milestones{/number}","notifications_url":"https://api.github.com/repos/hr-dash/hr-dash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hr-dash/hr-dash/labels{/name}","releases_url":"https://api.github.com/repos/hr-dash/hr-dash/releases{/id}","deployments_url":"https://api.github.com/repos/hr-dash/hr-dash/deployments","created_at":"2015-09-17T12:15:06Z","updated_at":"2016-10-30T05:13:36Z","pushed_at":"2016-12-04T11:49:07Z","git_url":"git://github.com/hr-dash/hr-dash.git","ssh_url":"git@github.com:hr-dash/hr-dash.git","clone_url":"https://github.com/hr-dash/hr-dash.git","svn_url":"https://github.com/hr-dash/hr-dash","homepage":null,"size":1058,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":27,"forks":0,"open_issues":27,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/hr-dash/hr-dash/pulls/351"},"html":{"href":"https://github.com/hr-dash/hr-dash/pull/351"},"issue":{"href":"https://api.github.com/repos/hr-dash/hr-dash/issues/351"},"comments":{"href":"https://api.github.com/repos/hr-dash/hr-dash/issues/351/comments"},"review_comments":{"href":"https://api.github.com/repos/hr-dash/hr-dash/pulls/351/comments"},"review_comment":{"href":"https://api.github.com/repos/hr-dash/hr-dash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hr-dash/hr-dash/pulls/351/commits"},"statuses":{"href":"https://api.github.com/repos/hr-dash/hr-dash/statuses/5f9ab8821aeecf6b10bdae62217ae8905f055157"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":1,"review_comments":0,"commits":4,"additions":68,"deletions":39,"changed_files":6}}
{"actor":{"display_login":"ta-chibana"}}