New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-cache-middleware

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-cache-middleware

Simple caching middleware for Connect/Express-based applications

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

node-cache-middleware

Express middleware to cache API routes

Travis

The basics

const cacheMiddleware = require('node-cache-middleware');

app.get(
    '/slow_endpoint',
    cacheMiddleware({
        durationMilliseconds: 30 * 1000,
    }),
    (req, res, next) => "..."
);

Caching backends

This comes with a in-memory cache using the Node memory-cache package. It does support writing your own adapter for memcached/redis or whatever else floats your boat.

Credits

Based on kwhitley/apicache, and addisonj/node-cacher, but with some changes to better handle the thundering herd problem.

FAQs

Package last updated on 23 Sep 2016

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