<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          dnscacheNode.js 緩存代理

          聯(lián)合創(chuàng)作 · 2023-09-23 16:40

          dnscache for Node 封裝了 Node.js 的 dns 模塊方法,在這之間提供緩存層。每個(gè)到 dns 方法的調(diào)用看起來都是本地緩存。dnscache 非常類似 GOF Proxy 設(shè)計(jì)模式,提供一個(gè)緩存代理。

          dnscache 主要目標(biāo)是緩存大部分 dns 調(diào)用,避免網(wǎng)絡(luò)延遲,提升性能。

          安裝

          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

          瀏覽 13
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  国产日韩精品无码去免费专区国产 | 2025精品偷拍视频 | 日本欧美国产 | 99爱视频免费在线观看 | 久久久久日皮视频 |