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

cache-module

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cache-module

This is the module for the cache layer implementation

latest
Source
npmnpm
Version
0.0.6
Version published
Weekly downloads
12
-40%
Maintainers
1
Weekly downloads
 
Created
Source

Cache-module

This is the cache module for the proxy layer. This module maintains a simple collection of objects to store the request end points and the resultant data from the destination server. This is a scaled version instead of using a DB for caching.

The logic used for caching is very simple and straightforward. The request path serves as a key towards the resource data and current time in ms. The caching algorithm is as follows:

  • Request from proxy to cache
  • Is request already cached? 2.1 If yes, Is the time difference between the current time and cached time greater than the allowed expiration time in configuration? (ie if the data has expired as per config) 2.1.1 If yes, forward the request to destination and check if the cache left with storage? (Is the current cache elements size or the cache byte size has exceeded the configured values?). Do this check recursively and then add data to cache when available. 2.1.2 If no, return data. 2.2 If no, forward the request to destination and check if the cache left with storage? (Is the current cache elements size or the cache byte size has exceeded the configured values?). Do this check recursively and then add data to cache when available.

FAQs

Package last updated on 16 Oct 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