Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

node-noginx

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-noginx

It's a cache proxy middleware like logical nginx of node.js.

latest
Source
npmnpm
Version
1.2.5
Version published
Maintainers
1
Created
Source

noginx

Build Status

It's a cache proxy middleware like logical nginx of node.js with expressjs.

Install

npm install node-noginx --save

Usage

app.use(noginx([ < RegExp > , {
    rule: < RegExp > , // route match rule
    maxAge: < Number > , // ms, the cache data expired time
    keyQueries: [ < String > , < String > ], // picking params of query as cache-key
    timeout: < Number >, //  ms, max waitting time when cache unhit
    gzip: < Boolean > // disable gzip or not
}]), {
    maxAge: 3 * 1000, // ms, default 3000
    maxQueueSize: 5000, // max request watting queue size, default 5000, it will responce 503 when queue is full 
    maxCache: 5000, // default 5000
    cacheFreePercent: < Float >, // free percentage of maxCache when cache is overflow 
    timeout: 100, // ms, default 500
    debug: < Boolean >, // whether log debug info
    logger: < Function > // Log function
})

Test

npm test

Doc

Proxy method

  • res.render

    override:

      - res.render(tpl, data)
    
  • res.send

    override:

      - res.render(statusCode, body)
      - res.render(statusCode)
      - res.render(body)
    
  • res.json

    override:

      - res.json(obj)
    
  • res.redirect

    override:

      - res.redirect(url)
    

Proxy headers

  • Content-Type
  • Cache-Control

License

MIT

Keywords

node

FAQs

Package last updated on 09 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts