{"action":"created","issue":{"url":"https://api.github.com/repos/ipfs/go-ipfs/issues/1818","labels_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/1818/labels{/name}","comments_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/1818/comments","events_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/1818/events","html_url":"https://github.com/ipfs/go-ipfs/issues/1818","id":110710118,"number":1818,"title":"max-age, ETag for /ipns requests","user":{"login":"ion1","id":39660,"avatar_url":"https://avatars.githubusercontent.com/u/39660?v=3","gravatar_id":"","url":"https://api.github.com/users/ion1","html_url":"https://github.com/ion1","followers_url":"https://api.github.com/users/ion1/followers","following_url":"https://api.github.com/users/ion1/following{/other_user}","gists_url":"https://api.github.com/users/ion1/gists{/gist_id}","starred_url":"https://api.github.com/users/ion1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ion1/subscriptions","organizations_url":"https://api.github.com/users/ion1/orgs","repos_url":"https://api.github.com/users/ion1/repos","events_url":"https://api.github.com/users/ion1/events{/privacy}","received_events_url":"https://api.github.com/users/ion1/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ipfs/go-ipfs/labels/gateway","name":"gateway","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-10-09T18:09:11Z","updated_at":"2015-10-28T21:56:36Z","closed_at":null,"body":"The gateway does not seem to provide a Cache-Control/max-age header or an ETag for `/ipns` URLs.\r\n\r\nIt might be useful to assume *some* reasonable non-zero max-age for content on IPNS. A minute? Fifteen seconds?\r\n\r\nIt would also be good to serve an ETag corresponding to whatever IPFS hash the IPNS path resolved to."},"comment":{"url":"https://api.github.com/repos/ipfs/go-ipfs/issues/comments/152006956","html_url":"https://github.com/ipfs/go-ipfs/issues/1818#issuecomment-152006956","issue_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/1818","id":152006956,"user":{"login":"ion1","id":39660,"avatar_url":"https://avatars.githubusercontent.com/u/39660?v=3","gravatar_id":"","url":"https://api.github.com/users/ion1","html_url":"https://github.com/ion1","followers_url":"https://api.github.com/users/ion1/followers","following_url":"https://api.github.com/users/ion1/following{/other_user}","gists_url":"https://api.github.com/users/ion1/gists{/gist_id}","starred_url":"https://api.github.com/users/ion1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ion1/subscriptions","organizations_url":"https://api.github.com/users/ion1/orgs","repos_url":"https://api.github.com/users/ion1/repos","events_url":"https://api.github.com/users/ion1/events{/privacy}","received_events_url":"https://api.github.com/users/ion1/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T21:56:36Z","updated_at":"2015-10-28T21:56:36Z","body":"It was mentioned on IRC that `resolve` does not provide TTL information to be used for `max-age`.\r\n\r\n`resolveOnce` could be changed to return a TTL value. `resolve` could start at infinity-ish and compute the minimum of the previous TTL and what `resolveOnce` returned at each iteration.\r\n\r\nGiven that the DNS lookup functions in [the net package for Go](https://golang.org/pkg/net/) do not seem to provide TTL information at the moment, the DNS `resolveOnce` could return a reasonable guess like one minute. If a DNS record points to `/ipns/<keyhash>`, that IPNS record can still decrement the TTL according to the iteration above if a low cache time is desired."}}