{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/31080741","id":31080741,"diff_hunk":"@@ -30,117 +33,115 @@ config.action_controller.perform_caching = true\n \n ### Page Caching\n \n-Page caching is a Rails mechanism which allows the request for a generated page to be fulfilled by the webserver (i.e. Apache or NGINX), without ever having to go through the Rails stack at all. Obviously, this is super-fast. Unfortunately, it can't be applied to every situation (such as pages that need authentication) and since the webserver is literally just serving a file from the filesystem, cache expiration is an issue that needs to be dealt with.\n+Page caching is a Rails mechanism which allows the request for a generated page\n+to be fulfilled by the webserver (i.e. Apache or NGINX) without ever hitting\n+your Rails app. While this is super fast it can't be applied to every situation\n+(such as pages that need authentication). Also, because the webserver is\n+serving a file directly from the filesystem you will need to implement cache\n+expiration.\n \n INFO: Page Caching has been removed from Rails 4. See the [actionpack-page_caching gem](https://github.com/rails/actionpack-page_caching).\n \n ### Action Caching\n \n-Page Caching cannot be used for actions that have before filters - for example, pages that require authentication. This is where Action Caching comes in. Action Caching works like Page Caching except the incoming web request hits the Rails stack so that before filters can be run on it before the cache is served. This allows authentication and other restrictions to be run while still serving the result of the output from a cached copy.","path":"guides/source/caching_with_rails.md","position":53,"original_position":53,"commit_id":"32349f91fd1108d700d9f87ca2a75bb7f34facc3","original_commit_id":"32349f91fd1108d700d9f87ca2a75bb7f34facc3","user":{"login":"imtayadeway","id":1710874,"avatar_url":"https://avatars.githubusercontent.com/u/1710874?v=3","gravatar_id":"","url":"https://api.github.com/users/imtayadeway","html_url":"https://github.com/imtayadeway","followers_url":"https://api.github.com/users/imtayadeway/followers","following_url":"https://api.github.com/users/imtayadeway/following{/other_user}","gists_url":"https://api.github.com/users/imtayadeway/gists{/gist_id}","starred_url":"https://api.github.com/users/imtayadeway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imtayadeway/subscriptions","organizations_url":"https://api.github.com/users/imtayadeway/orgs","repos_url":"https://api.github.com/users/imtayadeway/repos","events_url":"https://api.github.com/users/imtayadeway/events{/privacy}","received_events_url":"https://api.github.com/users/imtayadeway/received_events","type":"User","site_admin":false},"body":"was this space removed intentionally?","created_at":"2015-05-26T21:16:32Z","updated_at":"2015-05-26T21:16:32Z","html_url":"https://github.com/rails/rails/pull/20054#discussion_r31080741","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/20054","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/31080741"},"html":{"href":"https://github.com/rails/rails/pull/20054#discussion_r31080741"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/20054"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/20054","id":34887230,"html_url":"https://github.com/rails/rails/pull/20054","diff_url":"https://github.com/rails/rails/pull/20054.diff","patch_url":"https://github.com/rails/rails/pull/20054.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/20054","number":20054,"state":"open","locked":false,"title":"updates caching guide to reflect current Rails capabilities [ci skip]","user":{"login":"trosborn","id":2323292,"avatar_url":"https://avatars.githubusercontent.com/u/2323292?v=3","gravatar_id":"","url":"https://api.github.com/users/trosborn","html_url":"https://github.com/trosborn","followers_url":"https://api.github.com/users/trosborn/followers","following_url":"https://api.github.com/users/trosborn/following{/other_user}","gists_url":"https://api.github.com/users/trosborn/gists{/gist_id}","starred_url":"https://api.github.com/users/trosborn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trosborn/subscriptions","organizations_url":"https://api.github.com/users/trosborn/orgs","repos_url":"https://api.github.com/users/trosborn/repos","events_url":"https://api.github.com/users/trosborn/events{/privacy}","received_events_url":"https://api.github.com/users/trosborn/received_events","type":"User","site_admin":false},"body":"The current caching guide explains how to handroll key-based cache expiration but Rails can now do this automagically. As such, I rewrote this section to instead explain how Rails' key-based expiration works, and how to use it.\r\n\r\nI also did minor tweaks in other sections for readability and grammar.\r\n\r\nEverything I know about caching I learned in the process of writing this guide, so if someone could closely read it for technical accuracy, that would be awesome :yellow_heart: ","created_at":"2015-05-07T06:44:49Z","updated_at":"2015-05-26T21:16:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9863ac4fd1e8ed3e35cc3fbcb8abc78793bb2ec0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/20054/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/20054/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/20054/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/32349f91fd1108d700d9f87ca2a75bb7f34facc3","head":{"label":"trosborn:master","ref":"master","sha":"32349f91fd1108d700d9f87ca2a75bb7f34facc3","user":{"login":"trosborn","id":2323292,"avatar_url":"https://avatars.githubusercontent.com/u/2323292?v=3","gravatar_id":"","url":"https://api.github.com/users/trosborn","html_url":"https://github.com/trosborn","followers_url":"https://api.github.com/users/trosborn/followers","following_url":"https://api.github.com/users/trosborn/following{/other_user}","gists_url":"https://api.github.com/users/trosborn/gists{/gist_id}","starred_url":"https://api.github.com/users/trosborn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trosborn/subscriptions","organizations_url":"https://api.github.com/users/trosborn/orgs","repos_url":"https://api.github.com/users/trosborn/repos","events_url":"https://api.github.com/users/trosborn/events{/privacy}","received_events_url":"https://api.github.com/users/trosborn/received_events","type":"User","site_admin":false},"repo":{"id":34282225,"name":"rails","full_name":"trosborn/rails","owner":{"login":"trosborn","id":2323292,"avatar_url":"https://avatars.githubusercontent.com/u/2323292?v=3","gravatar_id":"","url":"https://api.github.com/users/trosborn","html_url":"https://github.com/trosborn","followers_url":"https://api.github.com/users/trosborn/followers","following_url":"https://api.github.com/users/trosborn/following{/other_user}","gists_url":"https://api.github.com/users/trosborn/gists{/gist_id}","starred_url":"https://api.github.com/users/trosborn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trosborn/subscriptions","organizations_url":"https://api.github.com/users/trosborn/orgs","repos_url":"https://api.github.com/users/trosborn/repos","events_url":"https://api.github.com/users/trosborn/events{/privacy}","received_events_url":"https://api.github.com/users/trosborn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trosborn/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/trosborn/rails","forks_url":"https://api.github.com/repos/trosborn/rails/forks","keys_url":"https://api.github.com/repos/trosborn/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trosborn/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trosborn/rails/teams","hooks_url":"https://api.github.com/repos/trosborn/rails/hooks","issue_events_url":"https://api.github.com/repos/trosborn/rails/issues/events{/number}","events_url":"https://api.github.com/repos/trosborn/rails/events","assignees_url":"https://api.github.com/repos/trosborn/rails/assignees{/user}","branches_url":"https://api.github.com/repos/trosborn/rails/branches{/branch}","tags_url":"https://api.github.com/repos/trosborn/rails/tags","blobs_url":"https://api.github.com/repos/trosborn/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trosborn/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trosborn/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/trosborn/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trosborn/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/trosborn/rails/languages","stargazers_url":"https://api.github.com/repos/trosborn/rails/stargazers","contributors_url":"https://api.github.com/repos/trosborn/rails/contributors","subscribers_url":"https://api.github.com/repos/trosborn/rails/subscribers","subscription_url":"https://api.github.com/repos/trosborn/rails/subscription","commits_url":"https://api.github.com/repos/trosborn/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/trosborn/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/trosborn/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/trosborn/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/trosborn/rails/contents/{+path}","compare_url":"https://api.github.com/repos/trosborn/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trosborn/rails/merges","archive_url":"https://api.github.com/repos/trosborn/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trosborn/rails/downloads","issues_url":"https://api.github.com/repos/trosborn/rails/issues{/number}","pulls_url":"https://api.github.com/repos/trosborn/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/trosborn/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/trosborn/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trosborn/rails/labels{/name}","releases_url":"https://api.github.com/repos/trosborn/rails/releases{/id}","created_at":"2015-04-20T19:42:00Z","updated_at":"2015-05-08T19:12:30Z","pushed_at":"2015-05-23T19:26:36Z","git_url":"git://github.com/trosborn/rails.git","ssh_url":"git@github.com:trosborn/rails.git","clone_url":"https://github.com/trosborn/rails.git","svn_url":"https://github.com/trosborn/rails","homepage":"http://rubyonrails.org","size":142333,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"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":"rails:master","ref":"master","sha":"c10630b642bc6dc77b719385d6ba6a1569a6e739","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","created_at":"2008-04-11T02:19:47Z","updated_at":"2015-05-26T19:17:09Z","pushed_at":"2015-05-26T20:24:17Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":441113,"stargazers_count":26263,"watchers_count":26263,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10430,"mirror_url":null,"open_issues_count":807,"forks":10430,"open_issues":807,"watchers":26263,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/20054"},"html":{"href":"https://github.com/rails/rails/pull/20054"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/20054"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/20054/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/20054/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/20054/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/32349f91fd1108d700d9f87ca2a75bb7f34facc3"}}}}