{"action":"created","issue":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/6174","repository_url":"https://api.github.com/repos/ampproject/amphtml","labels_url":"https://api.github.com/repos/ampproject/amphtml/issues/6174/labels{/name}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/6174/comments","events_url":"https://api.github.com/repos/ampproject/amphtml/issues/6174/events","html_url":"https://github.com/ampproject/amphtml/issues/6174","id":189116554,"number":6174,"title":"Add AMP Cache Purge Ring","user":{"login":"dknecht","id":58620,"avatar_url":"https://avatars.githubusercontent.com/u/58620?v=3","gravatar_id":"","url":"https://api.github.com/users/dknecht","html_url":"https://github.com/dknecht","followers_url":"https://api.github.com/users/dknecht/followers","following_url":"https://api.github.com/users/dknecht/following{/other_user}","gists_url":"https://api.github.com/users/dknecht/gists{/gist_id}","starred_url":"https://api.github.com/users/dknecht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dknecht/subscriptions","organizations_url":"https://api.github.com/users/dknecht/orgs","repos_url":"https://api.github.com/users/dknecht/repos","events_url":"https://api.github.com/users/dknecht/events{/privacy}","received_events_url":"https://api.github.com/users/dknecht/received_events","type":"User","site_admin":false},"labels":[{"id":425188525,"url":"https://api.github.com/repos/ampproject/amphtml/labels/Related%20To:%20Google%20AMP%20Cache","name":"Related To: Google AMP Cache","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":{"login":"dvoytenko","id":726049,"avatar_url":"https://avatars.githubusercontent.com/u/726049?v=3","gravatar_id":"","url":"https://api.github.com/users/dvoytenko","html_url":"https://github.com/dvoytenko","followers_url":"https://api.github.com/users/dvoytenko/followers","following_url":"https://api.github.com/users/dvoytenko/following{/other_user}","gists_url":"https://api.github.com/users/dvoytenko/gists{/gist_id}","starred_url":"https://api.github.com/users/dvoytenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvoytenko/subscriptions","organizations_url":"https://api.github.com/users/dvoytenko/orgs","repos_url":"https://api.github.com/users/dvoytenko/repos","events_url":"https://api.github.com/users/dvoytenko/events{/privacy}","received_events_url":"https://api.github.com/users/dvoytenko/received_events","type":"User","site_admin":false},"assignees":[{"login":"dvoytenko","id":726049,"avatar_url":"https://avatars.githubusercontent.com/u/726049?v=3","gravatar_id":"","url":"https://api.github.com/users/dvoytenko","html_url":"https://github.com/dvoytenko","followers_url":"https://api.github.com/users/dvoytenko/followers","following_url":"https://api.github.com/users/dvoytenko/following{/other_user}","gists_url":"https://api.github.com/users/dvoytenko/gists{/gist_id}","starred_url":"https://api.github.com/users/dvoytenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvoytenko/subscriptions","organizations_url":"https://api.github.com/users/dvoytenko/orgs","repos_url":"https://api.github.com/users/dvoytenko/repos","events_url":"https://api.github.com/users/dvoytenko/events{/privacy}","received_events_url":"https://api.github.com/users/dvoytenko/received_events","type":"User","site_admin":false},{"login":"vitaliybl","id":11186267,"avatar_url":"https://avatars.githubusercontent.com/u/11186267?v=3","gravatar_id":"","url":"https://api.github.com/users/vitaliybl","html_url":"https://github.com/vitaliybl","followers_url":"https://api.github.com/users/vitaliybl/followers","following_url":"https://api.github.com/users/vitaliybl/following{/other_user}","gists_url":"https://api.github.com/users/vitaliybl/gists{/gist_id}","starred_url":"https://api.github.com/users/vitaliybl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitaliybl/subscriptions","organizations_url":"https://api.github.com/users/vitaliybl/orgs","repos_url":"https://api.github.com/users/vitaliybl/repos","events_url":"https://api.github.com/users/vitaliybl/events{/privacy}","received_events_url":"https://api.github.com/users/vitaliybl/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/ampproject/amphtml/milestones/20","html_url":"https://github.com/ampproject/amphtml/milestones/Pending%20Triage","labels_url":"https://api.github.com/repos/ampproject/amphtml/milestones/20/labels","id":1884542,"number":20,"title":"Pending Triage","description":"These issues need to get put into another milestone. They should be assigned to the person who can best decide the appropriate milestone. Optionally, the issue can then be assigned to the most likely implementer.","creator":{"login":"rudygalfi","id":3888212,"avatar_url":"https://avatars.githubusercontent.com/u/3888212?v=3","gravatar_id":"","url":"https://api.github.com/users/rudygalfi","html_url":"https://github.com/rudygalfi","followers_url":"https://api.github.com/users/rudygalfi/followers","following_url":"https://api.github.com/users/rudygalfi/following{/other_user}","gists_url":"https://api.github.com/users/rudygalfi/gists{/gist_id}","starred_url":"https://api.github.com/users/rudygalfi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rudygalfi/subscriptions","organizations_url":"https://api.github.com/users/rudygalfi/orgs","repos_url":"https://api.github.com/users/rudygalfi/repos","events_url":"https://api.github.com/users/rudygalfi/events{/privacy}","received_events_url":"https://api.github.com/users/rudygalfi/received_events","type":"User","site_admin":false},"open_issues":199,"closed_issues":80,"state":"open","created_at":"2016-07-14T23:13:22Z","updated_at":"2016-11-26T22:07:06Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2016-11-14T13:48:55Z","updated_at":"2016-11-28T22:42:52Z","closed_at":null,"body":"In order to support multiple amp-caches and ensure that publishers only need to update content in a single place a purge ring should be created.  \r\n\r\nWhen an AMP Cache receives a purge request it will 302 redirect to the next amp cache location.  \r\n\r\nIn order to prevent a loop it will append a header saying which amp-cache has been purged.  \r\n\r\n1. Should we use a new header or a standard header such as VIA?\r\n2. Do the amp caches hard code in the next location or should we create a file that is served as part of amphtml scripts that can be periodically queried? \r\n\r\nInitially the only two locations will be cdn.ampproject.org and amp.cloudflare.com\r\n\r\nRelated to #6167 "},"comment":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/comments/263418406","html_url":"https://github.com/ampproject/amphtml/issues/6174#issuecomment-263418406","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/6174","id":263418406,"user":{"login":"jpettitt","id":524856,"avatar_url":"https://avatars.githubusercontent.com/u/524856?v=3","gravatar_id":"","url":"https://api.github.com/users/jpettitt","html_url":"https://github.com/jpettitt","followers_url":"https://api.github.com/users/jpettitt/followers","following_url":"https://api.github.com/users/jpettitt/following{/other_user}","gists_url":"https://api.github.com/users/jpettitt/gists{/gist_id}","starred_url":"https://api.github.com/users/jpettitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpettitt/subscriptions","organizations_url":"https://api.github.com/users/jpettitt/orgs","repos_url":"https://api.github.com/users/jpettitt/repos","events_url":"https://api.github.com/users/jpettitt/events{/privacy}","received_events_url":"https://api.github.com/users/jpettitt/received_events","type":"User","site_admin":false},"created_at":"2016-11-28T22:42:52Z","updated_at":"2016-11-28T22:42:52Z","body":"@vitaliybl We have a lot of logic in our system to manage caches. (our local one, our cdn, your cdn).  Our publishers require that we not serve stale content.  It's really important to them.  It's not clear what cache headers the amp-cache actually honours.  Perhaps documenting that would help us understand when we need to do a ping and when we can let it just expire.  \r\n\r\nRight now we have a couple of mechanisms, one time/age based when we set the max-age according the how long it is since the article was last modified. We also have an amp-analytics based velocity system that will refresh an article from source if it gets 100 AMP views before it's max-age (but no more than every 60 seconds).  In all cases we only ping the amp-cache if the content has changed.   Running 50+ sites, some very large, we're running at about 3% of quota for cache-purges right now.\r\n\r\nFWIW the biggest trigger of updates is googlebot requesting the amp page.  (we only purge our cache in that instance not the CDN cache).  \r\n\r\n@cramforce the api could be a simple json file in a well known location on cdn.ampproject.org that's managed in github. Caches could use it to figure out who to ping next in your ring scenario.\r\n\r\nPerhaps we can split the baby here and have individual endpoint urls, in a well known location and have the default be a 302 ring.  That way we could call each cache and just ignore the 302 response if we wanted to.\r\n\r\nOne other concern is scale, how many caches do you envisage existing?  302's are going to get fragile as the count grows (and we do see an occasion 502 error from the current cache).  An explicitly articulated retry/backoff guideline would be helpful to avoid thrashing all the caches that are still working if one is dead."}}
{"actor":{"display_login":"jpettitt"}}