{"action":"created","comment":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/178665605","pull_request_review_id":108749831,"id":178665605,"diff_hunk":"@@ -79,27 +79,27 @@ module.exports = {\n };\n ```\n \n-I played around with different options — currently, this single bundle.js file is in the `<head>` of my site, and is blocking. It’s final size is 829kb, and that includes every single non-image asset (fonts, css, all libraries and dependencies, and js). The vast majority of this is are the font-awesome fonts, which make up 724 of the 829kb.\n+目前我使用了不同的选项，这个 bundle.js 文件在我网站的 `<head>` 中，并且处于阻塞状态。它的最终大小是 829 kb，包括每个非图像资源（字体、css、所有的库、依赖项以及 js）。绝大多数字体使用的是 font-awesome，它们占 829 kb 中的 724。\n \n-I went through the Font Awesome library and stripped all but the three icons I was using — fa-github, fa-envelope, and fa-code. I used a service called [fontello](http://fontello.com/) to only pull the icons I needed. The new size was just 94kb.\n+我浏览了 Font Awesome 库，除了使用  fa-github、fa-envelope 和 fa-code 三个图标外，其他的所有图标都已经删除。我使用叫做 [fontello](http://fontello.com/) 的服务来提取我需要的图标。新的大小只有 94 kb。\n \n-The way the site is currently built, it won’t look correct if we only have stylesheets, so I accepted the blocking nature of a single bundle.js. Load times are ~118ms, which is more than an order of magnitude better than above.\n+按照目前网站的构建方式，如果我们只有样式表，它看起来是不正确的，所以我接受了单个 bundle.js 的阻塞特性。负载次数为 118 ms，比上诉提高了一个数量级。\n \n-This also had a few added benefits — I was no longer pointing to 3rd party resources or CDNs, so the user would not need to 1) perform a DNS query to that resource, 2) Perform the https handshake, and 3) actually wait for the full download from that resource.\n+这也带来了一些额外的好处 -- 不再指向第三方资源或 CDN，因此用户不需要：（1）执行对该资源的 DNS 查询，（2）执行 https 握手，（3）实际等待从该资源进行的完整下载。\n \n-While CDNs and distributed caching might make sense for large scale, distributed sites, it does not make sense for my small static site. The additional hundred milliseconds or so are a worthwhile tradeoff.\n+虽然 CDN 和分布式缓存对于大规模的分布式网站可能是有意义的，但对于我的小型静态网站来说却没有意义。额外的 100 毫秒是值得权衡的。","path":"TODO1/optimizing-a-static-site.md","position":81,"original_position":81,"commit_id":"4666796ee31fe56ad129305aa1859a7ac4406932","original_commit_id":"4666796ee31fe56ad129305aa1859a7ac4406932","user":{"login":"dandyxu","id":10475793,"avatar_url":"https://avatars2.githubusercontent.com/u/10475793?v=4","gravatar_id":"","url":"https://api.github.com/users/dandyxu","html_url":"https://github.com/dandyxu","followers_url":"https://api.github.com/users/dandyxu/followers","following_url":"https://api.github.com/users/dandyxu/following{/other_user}","gists_url":"https://api.github.com/users/dandyxu/gists{/gist_id}","starred_url":"https://api.github.com/users/dandyxu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dandyxu/subscriptions","organizations_url":"https://api.github.com/users/dandyxu/orgs","repos_url":"https://api.github.com/users/dandyxu/repos","events_url":"https://api.github.com/users/dandyxu/events{/privacy}","received_events_url":"https://api.github.com/users/dandyxu/received_events","type":"User","site_admin":false},"body":"[值得权衡的] -> [值得争取的]","created_at":"2018-04-02T22:14:22Z","updated_at":"2018-04-02T22:32:38Z","html_url":"https://github.com/xitu/gold-miner/pull/3577#discussion_r178665605","pull_request_url":"https://api.github.com/repos/xitu/gold-miner/pulls/3577","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/178665605"},"html":{"href":"https://github.com/xitu/gold-miner/pull/3577#discussion_r178665605"},"pull_request":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/3577"}}},"pull_request":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/3577","id":178875611,"html_url":"https://github.com/xitu/gold-miner/pull/3577","diff_url":"https://github.com/xitu/gold-miner/pull/3577.diff","patch_url":"https://github.com/xitu/gold-miner/pull/3577.patch","issue_url":"https://api.github.com/repos/xitu/gold-miner/issues/3577","number":3577,"state":"open","locked":false,"title":"提高 10 倍性能：优化静态网站","user":{"login":"Starriers","id":24243206,"avatar_url":"https://avatars2.githubusercontent.com/u/24243206?v=4","gravatar_id":"","url":"https://api.github.com/users/Starriers","html_url":"https://github.com/Starriers","followers_url":"https://api.github.com/users/Starriers/followers","following_url":"https://api.github.com/users/Starriers/following{/other_user}","gists_url":"https://api.github.com/users/Starriers/gists{/gist_id}","starred_url":"https://api.github.com/users/Starriers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Starriers/subscriptions","organizations_url":"https://api.github.com/users/Starriers/orgs","repos_url":"https://api.github.com/users/Starriers/repos","events_url":"https://api.github.com/users/Starriers/events{/privacy}","received_events_url":"https://api.github.com/users/Starriers/received_events","type":"User","site_admin":false},"body":"译文翻译完成，resolve #3568 \r\n","created_at":"2018-04-02T16:38:25Z","updated_at":"2018-04-02T22:32:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"daf1e3863bc0c1b2cff177ae99cd8cdac93df9ab","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":329563971,"url":"https://api.github.com/repos/xitu/gold-miner/labels/%E6%A0%A1%E5%AF%B9%E8%AE%A4%E9%A2%86","name":"校对认领","color":"ff5722","default":false},{"id":322084033,"url":"https://api.github.com/repos/xitu/gold-miner/labels/%E6%AD%A3%E5%9C%A8%E6%A0%A1%E5%AF%B9","name":"正在校对","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/xitu/gold-miner/pulls/3577/commits","review_comments_url":"https://api.github.com/repos/xitu/gold-miner/pulls/3577/comments","review_comment_url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xitu/gold-miner/issues/3577/comments","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/4666796ee31fe56ad129305aa1859a7ac4406932","head":{"label":"Starriers:translation/optimizing-a-static-site","ref":"translation/optimizing-a-static-site","sha":"4666796ee31fe56ad129305aa1859a7ac4406932","user":{"login":"Starriers","id":24243206,"avatar_url":"https://avatars2.githubusercontent.com/u/24243206?v=4","gravatar_id":"","url":"https://api.github.com/users/Starriers","html_url":"https://github.com/Starriers","followers_url":"https://api.github.com/users/Starriers/followers","following_url":"https://api.github.com/users/Starriers/following{/other_user}","gists_url":"https://api.github.com/users/Starriers/gists{/gist_id}","starred_url":"https://api.github.com/users/Starriers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Starriers/subscriptions","organizations_url":"https://api.github.com/users/Starriers/orgs","repos_url":"https://api.github.com/users/Starriers/repos","events_url":"https://api.github.com/users/Starriers/events{/privacy}","received_events_url":"https://api.github.com/users/Starriers/received_events","type":"User","site_admin":false},"repo":{"id":123270174,"name":"gold-miner","full_name":"Starriers/gold-miner","owner":{"login":"Starriers","id":24243206,"avatar_url":"https://avatars2.githubusercontent.com/u/24243206?v=4","gravatar_id":"","url":"https://api.github.com/users/Starriers","html_url":"https://github.com/Starriers","followers_url":"https://api.github.com/users/Starriers/followers","following_url":"https://api.github.com/users/Starriers/following{/other_user}","gists_url":"https://api.github.com/users/Starriers/gists{/gist_id}","starred_url":"https://api.github.com/users/Starriers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Starriers/subscriptions","organizations_url":"https://api.github.com/users/Starriers/orgs","repos_url":"https://api.github.com/users/Starriers/repos","events_url":"https://api.github.com/users/Starriers/events{/privacy}","received_events_url":"https://api.github.com/users/Starriers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Starriers/gold-miner","description":"🥇掘金翻译计划，可能是世界最大最好的英译中技术社区，最懂读者和译者的翻译平台：","fork":true,"url":"https://api.github.com/repos/Starriers/gold-miner","forks_url":"https://api.github.com/repos/Starriers/gold-miner/forks","keys_url":"https://api.github.com/repos/Starriers/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Starriers/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Starriers/gold-miner/teams","hooks_url":"https://api.github.com/repos/Starriers/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/Starriers/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/Starriers/gold-miner/events","assignees_url":"https://api.github.com/repos/Starriers/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/Starriers/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/Starriers/gold-miner/tags","blobs_url":"https://api.github.com/repos/Starriers/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Starriers/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Starriers/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/Starriers/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Starriers/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/Starriers/gold-miner/languages","stargazers_url":"https://api.github.com/repos/Starriers/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/Starriers/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/Starriers/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/Starriers/gold-miner/subscription","commits_url":"https://api.github.com/repos/Starriers/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/Starriers/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/Starriers/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/Starriers/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/Starriers/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/Starriers/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Starriers/gold-miner/merges","archive_url":"https://api.github.com/repos/Starriers/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Starriers/gold-miner/downloads","issues_url":"https://api.github.com/repos/Starriers/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/Starriers/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/Starriers/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/Starriers/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Starriers/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/Starriers/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/Starriers/gold-miner/deployments","created_at":"2018-02-28T10:37:28Z","updated_at":"2018-04-02T15:16:53Z","pushed_at":"2018-04-02T16:39:50Z","git_url":"git://github.com/Starriers/gold-miner.git","ssh_url":"git@github.com:Starriers/gold-miner.git","clone_url":"https://github.com/Starriers/gold-miner.git","svn_url":"https://github.com/Starriers/gold-miner","homepage":"https://juejin.im/tag/掘金翻译计划","size":31241,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xitu:master","ref":"master","sha":"bd9629addbbd146709f0cc388bd9ca5e251f7fb0","user":{"login":"xitu","id":10482599,"avatar_url":"https://avatars2.githubusercontent.com/u/10482599?v=4","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"repo":{"id":45512989,"name":"gold-miner","full_name":"xitu/gold-miner","owner":{"login":"xitu","id":10482599,"avatar_url":"https://avatars2.githubusercontent.com/u/10482599?v=4","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xitu/gold-miner","description":"🥇掘金翻译计划，可能是世界最大最好的英译中技术社区，最懂读者和译者的翻译平台：","fork":false,"url":"https://api.github.com/repos/xitu/gold-miner","forks_url":"https://api.github.com/repos/xitu/gold-miner/forks","keys_url":"https://api.github.com/repos/xitu/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xitu/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xitu/gold-miner/teams","hooks_url":"https://api.github.com/repos/xitu/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/xitu/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/xitu/gold-miner/events","assignees_url":"https://api.github.com/repos/xitu/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/xitu/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/xitu/gold-miner/tags","blobs_url":"https://api.github.com/repos/xitu/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xitu/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xitu/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/xitu/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/xitu/gold-miner/languages","stargazers_url":"https://api.github.com/repos/xitu/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/xitu/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/xitu/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/xitu/gold-miner/subscription","commits_url":"https://api.github.com/repos/xitu/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/xitu/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/xitu/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/xitu/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/xitu/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/xitu/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xitu/gold-miner/merges","archive_url":"https://api.github.com/repos/xitu/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xitu/gold-miner/downloads","issues_url":"https://api.github.com/repos/xitu/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/xitu/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/xitu/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/xitu/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xitu/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/xitu/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/xitu/gold-miner/deployments","created_at":"2015-11-04T03:29:13Z","updated_at":"2018-04-02T18:34:13Z","pushed_at":"2018-04-02T16:39:51Z","git_url":"git://github.com/xitu/gold-miner.git","ssh_url":"git@github.com:xitu/gold-miner.git","clone_url":"https://github.com/xitu/gold-miner.git","svn_url":"https://github.com/xitu/gold-miner","homepage":"https://juejin.im/tag/掘金翻译计划","size":31136,"stargazers_count":12881,"watchers_count":12881,"language":null,"has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2312,"mirror_url":null,"archived":false,"open_issues_count":39,"license":null,"forks":2312,"open_issues":39,"watchers":12881,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/3577"},"html":{"href":"https://github.com/xitu/gold-miner/pull/3577"},"issue":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/3577"},"comments":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/3577/comments"},"review_comments":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/3577/comments"},"review_comment":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/3577/commits"},"statuses":{"href":"https://api.github.com/repos/xitu/gold-miner/statuses/4666796ee31fe56ad129305aa1859a7ac4406932"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dandyxu"}}