<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
text-indent:21.0pt;
font-size:10.5pt;
font-family:"Calibri","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:446588090;
mso-list-type:hybrid;
mso-list-template-ids:-1272694212 -1046581204 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:18.0pt;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-text:"%2\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:42.0pt;
text-indent:-21.0pt;}
@list l1
{mso-list-id:1298954309;
mso-list-type:hybrid;
mso-list-template-ids:-1518053940 -1987674908 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
{mso-level-number-format:alpha-lower;
mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l2
{mso-list-id:1363823551;
mso-list-type:hybrid;
mso-list-template-ids:-41506268 -135090092 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l2:level1
{mso-level-number-format:alpha-lower;
mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l3
{mso-list-id:1703432559;
mso-list-type:hybrid;
mso-list-template-ids:-2068251098 -347167274 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l3:level1
{mso-level-number-format:bullet;
mso-level-text:\F06C;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;
mso-fareast-font-family:SimSun;
mso-bidi-font-family:"Times New Roman";}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hi all:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>For negative cache implementation, we may have 2 different designs:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US>Implement a standalone negative_cache for negative answers , then put all the NXDOMAIN answers there, the normal responses and NOERROR_NODATA responses can be put into the normal_cache.<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;text-indent:0cm'><span lang=EN-US>Then the logic will be:<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l2 level1 lfo2'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>a)<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US>Look up the normal_cache, if found and not expired, return it, if not found goto step b)<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l2 level1 lfo2'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>b)<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US>Look up the negative_cache, if found and not expired, return it, otherwise goto step c)<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l2 level1 lfo2'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>c)<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US>Send request to authoritative servers.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:18.0pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:18.0pt'><span lang=EN-US>For NOERROR_NODATA response, if cached and make response, the TTL need to be recalculated because the SOA record is shared between normal SOA record response and negative cache respond.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:18.0pt'><span lang=EN-US>For NXDOMAIN, this can be shared between different types, that means if the request for “A” record of xxx.example.com returns NXDOMAIN, all the other types request for xxx.example.com should also return NXDOMAIN, this can avoid unnecessary requests to authoritative servers( CNAME may need special process ).<o:p></o:p></span></p><p class=MsoNormal style='margin-left:18.0pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:18.0pt'><span lang=EN-US>The advantages for this design are:<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l3 level1 lfo4'><![if !supportLists]><span lang=EN-US style='font-family:Wingdings'><span style='mso-list:Ignore'>l<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US>The NXDOMAIN info can be shared between different types for the same domain name request, but if most requests is type A, this advantage may not be so obvious.<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l3 level1 lfo4'><![if !supportLists]><span lang=EN-US style='font-family:Wingdings'><span style='mso-list:Ignore'>l<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US>The negative cache is independent of normal cache, avoid a lot of NXDOMAIN requests flushing normal cache<o:p></o:p></span></p><p class=MsoNormal style='margin-left:18.0pt'><span lang=EN-US>The disadvantages for this design are:<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l3 level1 lfo4'><![if !supportLists]><span lang=EN-US style='font-family:Wingdings'><span style='mso-list:Ignore'>l<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US>The design may be more complicated<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l3 level1 lfo4'><![if !supportLists]><span lang=EN-US style='font-family:Wingdings'><span style='mso-list:Ignore'>l<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US>It need lookup twice if not found in the normal_cache.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US>Keep only one cache and make special process for NXDOMAIN and NOERROR_NODATA.<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;text-indent:0cm'><span lang=EN-US>This can keep current implementation almost intact except some special processing for NXDOMAIN/NOERROR responses.<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;text-indent:0cm'><span lang=EN-US>But this design cannot make NXDOMAIN info shared between different types for the same domain name because the cache is keyed with (DOMAIN NAME, TYPE).<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;text-indent:0cm'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;text-indent:0cm'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;text-indent:0cm'><span lang=EN-US>Any comments will be greatly appreciated. Thanks.<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;text-indent:0cm'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraph style='margin-left:18.0pt;text-indent:0cm'><span lang=EN-US>Ocean<o:p></o:p></span></p></div></body></html>