6. 实现考虑事项 (Implementation Considerations)
本节是 non-normative, 仅由可能对 implementors 有用的各种事项组成. recursive resolver 可以用多种方式实现其 cache. 最明显的一种是 tree data structure, 因为它符合 domain names 的数据模型. 但在实践中, 其他实现也是可能的, 也可以采用各种优化, 例如在 tree 上增加某些常见 domain names 的 index.
如果 resolver 将其 cache 实现为 tree (没有任何优化), 遵循第 2 节规则的一种方式如下: 收到 NXDOMAIN 时, 修剪该 node 处 positive cache entries 的 subtree, 或删除该 node 以下名称的所有单独 cache entries. 然后, 当在其 cache 中向下搜索时, 此 iterative caching DNS resolver 如果遇到已缓存的不存在性, 将停止搜索.
某些 resolvers 的 cache 可能并非组织为 tree, 而是例如组织为 dictionary; 因此, 它们有理由忽略第 2 节的规则. 所以这些规则使用 SHOULD 而不是 MUST.