dnscache Node.js 缓存代理

程序名称:dnscache

授权协议: BSD

操作系统: 跨平台

开发语言: JavaScript

dnscache 介绍

dnscache for Node 封装了 Node.js 的 dns
模块方法,在这之间提供缓存层。每个到 dns 方法的调用看起来都是本地缓存。dnscache 非常类似 GOF Proxy 设计模式,提供一个缓存代理。

dnscache 主要目标是缓存大部分 dns 调用,避免网络延迟,提升性能。

安装

npm install dnscache

使用

var dns = require('dns'),
    dnscache = require('dnscache')({
        "enable" : true,
        "ttl" : 300,
        "cachesize" : 1000
    });

    //to use the cached dns either of dnscache or dns can be called.
    //all the methods of dns are wrapped, this one just shows lookup on an example
    //will call the wrapped dns
    dnscache.lookup('www.yahoo.com', function(err, result) {
        //do something with result
    });

    //will call the wrapped dns
    dns.lookup('www.google.com', function(err, result) {
        //do something with result
    });

配置

  • enable

  • ttl

  • cachesize

  • cache

dnscache 官网

https://github.com/yahoo/dnscache

相关编程语言

BlazeDS 是一个基于服务器的Java 远程控制(remoting...
OVal 是一个可扩展的Java对象数据验证框架,验证的规...
Volta 是一套开发工具,专为开发分布式、实时系统应...
OpenDDS 是一个开源的 C++ 实现的 对象管理组织 OMG...
JADE (Java Agent DEvelopment Framework) 是一个完...
FastMM ,在D2006和2007中已代替了原来的内存管理器。