{"action":"created","issue":{"url":"https://api.github.com/repos/miekg/coredns/issues/30","repository_url":"https://api.github.com/repos/miekg/coredns","labels_url":"https://api.github.com/repos/miekg/coredns/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/miekg/coredns/issues/30/comments","events_url":"https://api.github.com/repos/miekg/coredns/issues/30/events","html_url":"https://github.com/miekg/coredns/issues/30","id":142183738,"number":30,"title":"middleware: caching","user":{"login":"miekg","id":353371,"avatar_url":"https://avatars.githubusercontent.com/u/353371?v=3","gravatar_id":"","url":"https://api.github.com/users/miekg","html_url":"https://github.com/miekg","followers_url":"https://api.github.com/users/miekg/followers","following_url":"https://api.github.com/users/miekg/following{/other_user}","gists_url":"https://api.github.com/users/miekg/gists{/gist_id}","starred_url":"https://api.github.com/users/miekg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miekg/subscriptions","organizations_url":"https://api.github.com/users/miekg/orgs","repos_url":"https://api.github.com/users/miekg/repos","events_url":"https://api.github.com/users/miekg/events{/privacy}","received_events_url":"https://api.github.com/users/miekg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-20T17:24:04Z","updated_at":"2016-04-13T19:59:44Z","closed_at":null,"body":"a caching middleware"},"comment":{"url":"https://api.github.com/repos/miekg/coredns/issues/comments/209622507","html_url":"https://github.com/miekg/coredns/issues/30#issuecomment-209622507","issue_url":"https://api.github.com/repos/miekg/coredns/issues/30","id":209622507,"user":{"login":"miekg","id":353371,"avatar_url":"https://avatars.githubusercontent.com/u/353371?v=3","gravatar_id":"","url":"https://api.github.com/users/miekg","html_url":"https://github.com/miekg","followers_url":"https://api.github.com/users/miekg/followers","following_url":"https://api.github.com/users/miekg/following{/other_user}","gists_url":"https://api.github.com/users/miekg/gists{/gist_id}","starred_url":"https://api.github.com/users/miekg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miekg/subscriptions","organizations_url":"https://api.github.com/users/miekg/orgs","repos_url":"https://api.github.com/users/miekg/repos","events_url":"https://api.github.com/users/miekg/events{/privacy}","received_events_url":"https://api.github.com/users/miekg/received_events","type":"User","site_admin":false},"created_at":"2016-04-13T19:59:44Z","updated_at":"2016-04-13T19:59:44Z","body":"Should we cache RRset or complete messages? The former is how you should do it, but what it that leads to a partial answer? Then you need to get fetch it from somewhere.. do you then invoke the next middleware? That could work.\r\nOr you could cache complete answers, but then there is a problem of multiple clients with different buffer sizes (or even transport), i.e. you can't re-use a TCP message when a client comes asking via UDP.\r\n\r\nThe first approach makes most sense, it's RFC compliant, and if you find that answer incomplete just hand off to the next middleware."}}