{"action":"created","comment":{"url":"https://api.github.com/repos/tootsuite/documentation/pulls/comments/112821485","pull_request_review_id":34168441,"id":112821485,"diff_hunk":"@@ -63,6 +63,12 @@ server {\n     try_files $uri @proxy;\n   }\n \n+  location /assets {\n+    # Serve static, checksummed assets directly from nginx as a perf boost\n+    root /home/mastodon/live/public;","path":"Running-Mastodon/Production-guide.md","position":6,"original_position":6,"commit_id":"32f4c5319f0f353abefbe92c393f07aae4a62d81","original_commit_id":"32f4c5319f0f353abefbe92c393f07aae4a62d81","user":{"login":"nightpool","id":233815,"avatar_url":"https://avatars1.githubusercontent.com/u/233815?v=3","gravatar_id":"","url":"https://api.github.com/users/nightpool","html_url":"https://github.com/nightpool","followers_url":"https://api.github.com/users/nightpool/followers","following_url":"https://api.github.com/users/nightpool/following{/other_user}","gists_url":"https://api.github.com/users/nightpool/gists{/gist_id}","starred_url":"https://api.github.com/users/nightpool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nightpool/subscriptions","organizations_url":"https://api.github.com/users/nightpool/orgs","repos_url":"https://api.github.com/users/nightpool/repos","events_url":"https://api.github.com/users/nightpool/events{/privacy}","received_events_url":"https://api.github.com/users/nightpool/received_events","type":"User","site_admin":false},"body":"note that this is duplicated from the try_files on line 63 and the root declaration on line 49. You probably only need the cache-control header here.","created_at":"2017-04-22T23:56:52Z","updated_at":"2017-04-22T23:56:52Z","html_url":"https://github.com/tootsuite/documentation/pull/136#discussion_r112821485","pull_request_url":"https://api.github.com/repos/tootsuite/documentation/pulls/136","_links":{"self":{"href":"https://api.github.com/repos/tootsuite/documentation/pulls/comments/112821485"},"html":{"href":"https://github.com/tootsuite/documentation/pull/136#discussion_r112821485"},"pull_request":{"href":"https://api.github.com/repos/tootsuite/documentation/pulls/136"}}},"pull_request":{"url":"https://api.github.com/repos/tootsuite/documentation/pulls/136","id":117129229,"html_url":"https://github.com/tootsuite/documentation/pull/136","diff_url":"https://github.com/tootsuite/documentation/pull/136.diff","patch_url":"https://github.com/tootsuite/documentation/pull/136.patch","issue_url":"https://api.github.com/repos/tootsuite/documentation/issues/136","number":136,"state":"open","locked":false,"title":"Add nginx config for static assets","user":{"login":"nolanlawson","id":283842,"avatar_url":"https://avatars3.githubusercontent.com/u/283842?v=3","gravatar_id":"","url":"https://api.github.com/users/nolanlawson","html_url":"https://github.com/nolanlawson","followers_url":"https://api.github.com/users/nolanlawson/followers","following_url":"https://api.github.com/users/nolanlawson/following{/other_user}","gists_url":"https://api.github.com/users/nolanlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanlawson/subscriptions","organizations_url":"https://api.github.com/users/nolanlawson/orgs","repos_url":"https://api.github.com/users/nolanlawson/repos","events_url":"https://api.github.com/users/nolanlawson/events{/privacy}","received_events_url":"https://api.github.com/users/nolanlawson/received_events","type":"User","site_admin":false},"body":"AFAICT there's no reason not to serve static assets directly from nginx, so this seems like a reasonable recommendation for the official docs.\r\n\r\nI also added a high enough cache time and `cache-control:immutable` because all these resources have their checksums in the names, so they can essentially be cached indefinitely. `cache-control:immutable` is in Firefox 49+ and Edge 15 and causes the browser to skip an unnecessary revalidation request even when hitting reload/F5 ([details here](https://hacks.mozilla.org/2017/01/using-immutable-caching-to-speed-up-the-web/)). Chrome doesn't have this but it has a heuristic, and I confirmed that 31536000 (365 days) matches the heuristic so it avoids the revalidation as well.","created_at":"2017-04-22T23:23:45Z","updated_at":"2017-04-22T23:56:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"347c5091ec21fad1adbcfa55995ef614f233c161","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/tootsuite/documentation/pulls/136/commits","review_comments_url":"https://api.github.com/repos/tootsuite/documentation/pulls/136/comments","review_comment_url":"https://api.github.com/repos/tootsuite/documentation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tootsuite/documentation/issues/136/comments","statuses_url":"https://api.github.com/repos/tootsuite/documentation/statuses/32f4c5319f0f353abefbe92c393f07aae4a62d81","head":{"label":"nolanlawson:static-assets","ref":"static-assets","sha":"32f4c5319f0f353abefbe92c393f07aae4a62d81","user":{"login":"nolanlawson","id":283842,"avatar_url":"https://avatars3.githubusercontent.com/u/283842?v=3","gravatar_id":"","url":"https://api.github.com/users/nolanlawson","html_url":"https://github.com/nolanlawson","followers_url":"https://api.github.com/users/nolanlawson/followers","following_url":"https://api.github.com/users/nolanlawson/following{/other_user}","gists_url":"https://api.github.com/users/nolanlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanlawson/subscriptions","organizations_url":"https://api.github.com/users/nolanlawson/orgs","repos_url":"https://api.github.com/users/nolanlawson/repos","events_url":"https://api.github.com/users/nolanlawson/events{/privacy}","received_events_url":"https://api.github.com/users/nolanlawson/received_events","type":"User","site_admin":false},"repo":{"id":89104945,"name":"documentation","full_name":"nolanlawson/documentation","owner":{"login":"nolanlawson","id":283842,"avatar_url":"https://avatars3.githubusercontent.com/u/283842?v=3","gravatar_id":"","url":"https://api.github.com/users/nolanlawson","html_url":"https://github.com/nolanlawson","followers_url":"https://api.github.com/users/nolanlawson/followers","following_url":"https://api.github.com/users/nolanlawson/following{/other_user}","gists_url":"https://api.github.com/users/nolanlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanlawson/subscriptions","organizations_url":"https://api.github.com/users/nolanlawson/orgs","repos_url":"https://api.github.com/users/nolanlawson/repos","events_url":"https://api.github.com/users/nolanlawson/events{/privacy}","received_events_url":"https://api.github.com/users/nolanlawson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nolanlawson/documentation","description":"Full documentation repository for Mastodon","fork":true,"url":"https://api.github.com/repos/nolanlawson/documentation","forks_url":"https://api.github.com/repos/nolanlawson/documentation/forks","keys_url":"https://api.github.com/repos/nolanlawson/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nolanlawson/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nolanlawson/documentation/teams","hooks_url":"https://api.github.com/repos/nolanlawson/documentation/hooks","issue_events_url":"https://api.github.com/repos/nolanlawson/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/nolanlawson/documentation/events","assignees_url":"https://api.github.com/repos/nolanlawson/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/nolanlawson/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/nolanlawson/documentation/tags","blobs_url":"https://api.github.com/repos/nolanlawson/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nolanlawson/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nolanlawson/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/nolanlawson/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nolanlawson/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/nolanlawson/documentation/languages","stargazers_url":"https://api.github.com/repos/nolanlawson/documentation/stargazers","contributors_url":"https://api.github.com/repos/nolanlawson/documentation/contributors","subscribers_url":"https://api.github.com/repos/nolanlawson/documentation/subscribers","subscription_url":"https://api.github.com/repos/nolanlawson/documentation/subscription","commits_url":"https://api.github.com/repos/nolanlawson/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/nolanlawson/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/nolanlawson/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/nolanlawson/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/nolanlawson/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/nolanlawson/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nolanlawson/documentation/merges","archive_url":"https://api.github.com/repos/nolanlawson/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nolanlawson/documentation/downloads","issues_url":"https://api.github.com/repos/nolanlawson/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/nolanlawson/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/nolanlawson/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/nolanlawson/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nolanlawson/documentation/labels{/name}","releases_url":"https://api.github.com/repos/nolanlawson/documentation/releases{/id}","deployments_url":"https://api.github.com/repos/nolanlawson/documentation/deployments","created_at":"2017-04-22T23:19:55Z","updated_at":"2017-04-22T22:08:22Z","pushed_at":"2017-04-22T23:20:05Z","git_url":"git://github.com/nolanlawson/documentation.git","ssh_url":"git@github.com:nolanlawson/documentation.git","clone_url":"https://github.com/nolanlawson/documentation.git","svn_url":"https://github.com/nolanlawson/documentation","homepage":"https://github.com/tootsuite/mastodon","size":34725,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tootsuite:master","ref":"master","sha":"863a5ea716f30c2dda62696d831c2b62c47c4a8b","user":{"login":"tootsuite","id":24979032,"avatar_url":"https://avatars0.githubusercontent.com/u/24979032?v=3","gravatar_id":"","url":"https://api.github.com/users/tootsuite","html_url":"https://github.com/tootsuite","followers_url":"https://api.github.com/users/tootsuite/followers","following_url":"https://api.github.com/users/tootsuite/following{/other_user}","gists_url":"https://api.github.com/users/tootsuite/gists{/gist_id}","starred_url":"https://api.github.com/users/tootsuite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tootsuite/subscriptions","organizations_url":"https://api.github.com/users/tootsuite/orgs","repos_url":"https://api.github.com/users/tootsuite/repos","events_url":"https://api.github.com/users/tootsuite/events{/privacy}","received_events_url":"https://api.github.com/users/tootsuite/received_events","type":"Organization","site_admin":false},"repo":{"id":87725017,"name":"documentation","full_name":"tootsuite/documentation","owner":{"login":"tootsuite","id":24979032,"avatar_url":"https://avatars0.githubusercontent.com/u/24979032?v=3","gravatar_id":"","url":"https://api.github.com/users/tootsuite","html_url":"https://github.com/tootsuite","followers_url":"https://api.github.com/users/tootsuite/followers","following_url":"https://api.github.com/users/tootsuite/following{/other_user}","gists_url":"https://api.github.com/users/tootsuite/gists{/gist_id}","starred_url":"https://api.github.com/users/tootsuite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tootsuite/subscriptions","organizations_url":"https://api.github.com/users/tootsuite/orgs","repos_url":"https://api.github.com/users/tootsuite/repos","events_url":"https://api.github.com/users/tootsuite/events{/privacy}","received_events_url":"https://api.github.com/users/tootsuite/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tootsuite/documentation","description":"Full documentation repository for Mastodon","fork":false,"url":"https://api.github.com/repos/tootsuite/documentation","forks_url":"https://api.github.com/repos/tootsuite/documentation/forks","keys_url":"https://api.github.com/repos/tootsuite/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tootsuite/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tootsuite/documentation/teams","hooks_url":"https://api.github.com/repos/tootsuite/documentation/hooks","issue_events_url":"https://api.github.com/repos/tootsuite/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/tootsuite/documentation/events","assignees_url":"https://api.github.com/repos/tootsuite/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/tootsuite/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/tootsuite/documentation/tags","blobs_url":"https://api.github.com/repos/tootsuite/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tootsuite/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tootsuite/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/tootsuite/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tootsuite/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/tootsuite/documentation/languages","stargazers_url":"https://api.github.com/repos/tootsuite/documentation/stargazers","contributors_url":"https://api.github.com/repos/tootsuite/documentation/contributors","subscribers_url":"https://api.github.com/repos/tootsuite/documentation/subscribers","subscription_url":"https://api.github.com/repos/tootsuite/documentation/subscription","commits_url":"https://api.github.com/repos/tootsuite/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/tootsuite/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/tootsuite/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/tootsuite/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/tootsuite/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/tootsuite/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tootsuite/documentation/merges","archive_url":"https://api.github.com/repos/tootsuite/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tootsuite/documentation/downloads","issues_url":"https://api.github.com/repos/tootsuite/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/tootsuite/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/tootsuite/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/tootsuite/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tootsuite/documentation/labels{/name}","releases_url":"https://api.github.com/repos/tootsuite/documentation/releases{/id}","deployments_url":"https://api.github.com/repos/tootsuite/documentation/deployments","created_at":"2017-04-09T17:07:21Z","updated_at":"2017-04-22T22:08:22Z","pushed_at":"2017-04-22T23:23:45Z","git_url":"git://github.com/tootsuite/documentation.git","ssh_url":"git@github.com:tootsuite/documentation.git","clone_url":"https://github.com/tootsuite/documentation.git","svn_url":"https://github.com/tootsuite/documentation","homepage":"https://github.com/tootsuite/mastodon","size":34725,"stargazers_count":242,"watchers_count":242,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":150,"mirror_url":null,"open_issues_count":28,"forks":150,"open_issues":28,"watchers":242,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tootsuite/documentation/pulls/136"},"html":{"href":"https://github.com/tootsuite/documentation/pull/136"},"issue":{"href":"https://api.github.com/repos/tootsuite/documentation/issues/136"},"comments":{"href":"https://api.github.com/repos/tootsuite/documentation/issues/136/comments"},"review_comments":{"href":"https://api.github.com/repos/tootsuite/documentation/pulls/136/comments"},"review_comment":{"href":"https://api.github.com/repos/tootsuite/documentation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tootsuite/documentation/pulls/136/commits"},"statuses":{"href":"https://api.github.com/repos/tootsuite/documentation/statuses/32f4c5319f0f353abefbe92c393f07aae4a62d81"}}}}
{"actor":{"display_login":"nightpool"}}