You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

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

0.0.5
latest
npmnpm
Version published
Weekly downloads
265
17.26%
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

express

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