Socket
Socket
Sign inDemoInstall

cacheme

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cacheme

Unobtrusively handles http cache based route and params


Version published
Weekly downloads
134
increased by26.42%
Maintainers
1
Weekly downloads
 
Created
Source

Nodejs Http Cache Helper

Coverage Status Build Status

A simple but robust Http cache helper

Installation

Node

npm install cacheme --save

Usage

You can simply use CacheMe as a classic middleware

{
    "main.strategy": {
        "priority": 1, // lower is more important
        "rules":  [
            {
                "method": "get, post, put, del, case insensitive",
                "path":"regex",
                "cache": {
                    override: 'public, smax-age: 40',
                    proxy: 'public',
                    unit: 'second, minute, hour, month, year',
                    duration: 60
                }

            }
        ]
    }
}

HttpCache can alos be use directly if you don't need to define strategy based on path

"cache": {
	override: 'public, smax-age: 40',
	proxy: 'public',
	unit: 'second, minute, hour, month, year',
	duration: 60,
    noRevalidate: true || false // this will erase Etag or Last-Modified hedader avoinding 304, default is false
}

Changelog

0.0.5

  • fix issue about middleware step, now revalidate header are only remove in last step on response.end

0.0.4

  • add support of removing revalidate header (Etag, Last-Modified)

0.0.3

  • fix issue with case on method

0.0.2

  • fix issue on exposing middleware

0.0.1

  • first commit

Roadmap

  • Add Expires headerpostMessage

Credits

Loïc Calvy

License

The MIT License

Keywords

FAQs

Package last updated on 22 Jan 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc