{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/amp-wp/pulls/comments/210174404","pull_request_review_id":146333957,"id":210174404,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDE3NDQwNA==","diff_hunk":"@@ -198,6 +200,12 @@ public static function validate_options( $new_options ) {\n \t\t// Store the current version with the options so we know the format.\n \t\t$options['version'] = AMP__VERSION;\n \n+\t\t// Handle the caching option.\n+\t\t$options['enable_response_caching'] = ! empty( $new_options['enable_response_caching'] );","path":"includes/options/class-amp-options-manager.php","position":21,"original_position":21,"commit_id":"1e6a8afba2e2c1d401de1422b832ec9151c85e55","original_commit_id":"1e6a8afba2e2c1d401de1422b832ec9151c85e55","user":{"login":"westonruter","id":134745,"node_id":"MDQ6VXNlcjEzNDc0NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/134745?v=4","gravatar_id":"","url":"https://api.github.com/users/westonruter","html_url":"https://github.com/westonruter","followers_url":"https://api.github.com/users/westonruter/followers","following_url":"https://api.github.com/users/westonruter/following{/other_user}","gists_url":"https://api.github.com/users/westonruter/gists{/gist_id}","starred_url":"https://api.github.com/users/westonruter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/westonruter/subscriptions","organizations_url":"https://api.github.com/users/westonruter/orgs","repos_url":"https://api.github.com/users/westonruter/repos","events_url":"https://api.github.com/users/westonruter/events{/privacy}","received_events_url":"https://api.github.com/users/westonruter/received_events","type":"User","site_admin":false},"body":"The condition here should probably be `wp_using_ext_object_cache() && ! empty( $new_options['enable_response_caching'] )`","created_at":"2018-08-15T05:31:26Z","updated_at":"2018-08-15T05:31:26Z","html_url":"https://github.com/Automattic/amp-wp/pull/1325#discussion_r210174404","pull_request_url":"https://api.github.com/repos/Automattic/amp-wp/pulls/1325","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Automattic/amp-wp/pulls/comments/210174404"},"html":{"href":"https://github.com/Automattic/amp-wp/pull/1325#discussion_r210174404"},"pull_request":{"href":"https://api.github.com/repos/Automattic/amp-wp/pulls/1325"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/amp-wp/pulls/1325","id":206848458,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2ODQ4NDU4","html_url":"https://github.com/Automattic/amp-wp/pull/1325","diff_url":"https://github.com/Automattic/amp-wp/pull/1325.diff","patch_url":"https://github.com/Automattic/amp-wp/pull/1325.patch","issue_url":"https://api.github.com/repos/Automattic/amp-wp/issues/1325","number":1325,"state":"open","locked":false,"title":"[WIP] Improve post processor response cache","user":{"login":"hellofromtonya","id":7284611,"node_id":"MDQ6VXNlcjcyODQ2MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/7284611?v=4","gravatar_id":"","url":"https://api.github.com/users/hellofromtonya","html_url":"https://github.com/hellofromtonya","followers_url":"https://api.github.com/users/hellofromtonya/followers","following_url":"https://api.github.com/users/hellofromtonya/following{/other_user}","gists_url":"https://api.github.com/users/hellofromtonya/gists{/gist_id}","starred_url":"https://api.github.com/users/hellofromtonya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellofromtonya/subscriptions","organizations_url":"https://api.github.com/users/hellofromtonya/orgs","repos_url":"https://api.github.com/users/hellofromtonya/repos","events_url":"https://api.github.com/users/hellofromtonya/events{/privacy}","received_events_url":"https://api.github.com/users/hellofromtonya/received_events","type":"User","site_admin":false},"body":"Randomly generated content can occur on a web page.  When that happens, the response will differ for each request causing cache misses for the plugin's AMP response cache.  As @westonruter notes in Issue #1239:\r\n\r\n>the object cache will get polluted with values that never get used.\r\n\r\nThis PR detects continual cache misses by caching the page's URL and then comparing the number of cached URLs to a threshold.  When that threshold is exceeded, it disables the response cache and then notifies the admin.\r\n\r\nTODO\r\n- [x] Detect continual cache misses\r\n- [x] Disable caching\r\n- [x] Notify\r\n- [x] Provide a UI to reset the option's value and re-enable response caching.\r\n\r\nCloses #1239.","created_at":"2018-08-07T22:53:02Z","updated_at":"2018-08-15T05:31:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"186240350b4bf2c5caa0143c30415d5b06afc622","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/amp-wp/pulls/1325/commits","review_comments_url":"https://api.github.com/repos/Automattic/amp-wp/pulls/1325/comments","review_comment_url":"https://api.github.com/repos/Automattic/amp-wp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/amp-wp/issues/1325/comments","statuses_url":"https://api.github.com/repos/Automattic/amp-wp/statuses/1e6a8afba2e2c1d401de1422b832ec9151c85e55","head":{"label":"Automattic:improve/post-processor-response-cache","ref":"improve/post-processor-response-cache","sha":"1e6a8afba2e2c1d401de1422b832ec9151c85e55","user":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":42912130,"node_id":"MDEwOlJlcG9zaXRvcnk0MjkxMjEzMA==","name":"amp-wp","full_name":"Automattic/amp-wp","owner":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/amp-wp","description":"WordPress plugin for adding AMP support","fork":false,"url":"https://api.github.com/repos/Automattic/amp-wp","forks_url":"https://api.github.com/repos/Automattic/amp-wp/forks","keys_url":"https://api.github.com/repos/Automattic/amp-wp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/amp-wp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/amp-wp/teams","hooks_url":"https://api.github.com/repos/Automattic/amp-wp/hooks","issue_events_url":"https://api.github.com/repos/Automattic/amp-wp/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/amp-wp/events","assignees_url":"https://api.github.com/repos/Automattic/amp-wp/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/amp-wp/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/amp-wp/tags","blobs_url":"https://api.github.com/repos/Automattic/amp-wp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/amp-wp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/amp-wp/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/amp-wp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/amp-wp/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/amp-wp/languages","stargazers_url":"https://api.github.com/repos/Automattic/amp-wp/stargazers","contributors_url":"https://api.github.com/repos/Automattic/amp-wp/contributors","subscribers_url":"https://api.github.com/repos/Automattic/amp-wp/subscribers","subscription_url":"https://api.github.com/repos/Automattic/amp-wp/subscription","commits_url":"https://api.github.com/repos/Automattic/amp-wp/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/amp-wp/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/amp-wp/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/amp-wp/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/amp-wp/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/amp-wp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/amp-wp/merges","archive_url":"https://api.github.com/repos/Automattic/amp-wp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/amp-wp/downloads","issues_url":"https://api.github.com/repos/Automattic/amp-wp/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/amp-wp/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/amp-wp/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/amp-wp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/amp-wp/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/amp-wp/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/amp-wp/deployments","created_at":"2015-09-22T04:52:15Z","updated_at":"2018-08-14T21:19:54Z","pushed_at":"2018-08-15T04:56:14Z","git_url":"git://github.com/Automattic/amp-wp.git","ssh_url":"git@github.com:Automattic/amp-wp.git","clone_url":"https://github.com/Automattic/amp-wp.git","svn_url":"https://github.com/Automattic/amp-wp","homepage":"https://wordpress.org/plugins/amp/","size":11950,"stargazers_count":1198,"watchers_count":1198,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":267,"mirror_url":null,"archived":false,"open_issues_count":87,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":267,"open_issues":87,"watchers":1198,"default_branch":"develop"}},"base":{"label":"Automattic:develop","ref":"develop","sha":"f9e79b1d16841d2a097378acaa4567c88961bb23","user":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":42912130,"node_id":"MDEwOlJlcG9zaXRvcnk0MjkxMjEzMA==","name":"amp-wp","full_name":"Automattic/amp-wp","owner":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/amp-wp","description":"WordPress plugin for adding AMP support","fork":false,"url":"https://api.github.com/repos/Automattic/amp-wp","forks_url":"https://api.github.com/repos/Automattic/amp-wp/forks","keys_url":"https://api.github.com/repos/Automattic/amp-wp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/amp-wp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/amp-wp/teams","hooks_url":"https://api.github.com/repos/Automattic/amp-wp/hooks","issue_events_url":"https://api.github.com/repos/Automattic/amp-wp/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/amp-wp/events","assignees_url":"https://api.github.com/repos/Automattic/amp-wp/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/amp-wp/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/amp-wp/tags","blobs_url":"https://api.github.com/repos/Automattic/amp-wp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/amp-wp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/amp-wp/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/amp-wp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/amp-wp/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/amp-wp/languages","stargazers_url":"https://api.github.com/repos/Automattic/amp-wp/stargazers","contributors_url":"https://api.github.com/repos/Automattic/amp-wp/contributors","subscribers_url":"https://api.github.com/repos/Automattic/amp-wp/subscribers","subscription_url":"https://api.github.com/repos/Automattic/amp-wp/subscription","commits_url":"https://api.github.com/repos/Automattic/amp-wp/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/amp-wp/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/amp-wp/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/amp-wp/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/amp-wp/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/amp-wp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/amp-wp/merges","archive_url":"https://api.github.com/repos/Automattic/amp-wp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/amp-wp/downloads","issues_url":"https://api.github.com/repos/Automattic/amp-wp/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/amp-wp/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/amp-wp/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/amp-wp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/amp-wp/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/amp-wp/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/amp-wp/deployments","created_at":"2015-09-22T04:52:15Z","updated_at":"2018-08-14T21:19:54Z","pushed_at":"2018-08-15T04:56:14Z","git_url":"git://github.com/Automattic/amp-wp.git","ssh_url":"git@github.com:Automattic/amp-wp.git","clone_url":"https://github.com/Automattic/amp-wp.git","svn_url":"https://github.com/Automattic/amp-wp","homepage":"https://wordpress.org/plugins/amp/","size":11950,"stargazers_count":1198,"watchers_count":1198,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":267,"mirror_url":null,"archived":false,"open_issues_count":87,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":267,"open_issues":87,"watchers":1198,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/amp-wp/pulls/1325"},"html":{"href":"https://github.com/Automattic/amp-wp/pull/1325"},"issue":{"href":"https://api.github.com/repos/Automattic/amp-wp/issues/1325"},"comments":{"href":"https://api.github.com/repos/Automattic/amp-wp/issues/1325/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/amp-wp/pulls/1325/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/amp-wp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/amp-wp/pulls/1325/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/amp-wp/statuses/1e6a8afba2e2c1d401de1422b832ec9151c85e55"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"westonruter"}}