Gathering detailed insights and metrics for koajs-nocache
Gathering detailed insights and metrics for koajs-nocache
Gathering detailed insights and metrics for koajs-nocache
Gathering detailed insights and metrics for koajs-nocache
npm install koajs-nocache
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1 Stars
16 Commits
2 Forks
2 Watching
1 Branches
2 Contributors
Updated on 11 Nov 2020
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-26.7%
66
Compared to previous day
Last week
5.2%
423
Compared to previous week
Last month
24.2%
1,650
Compared to previous month
Last year
15.4%
19,206
Compared to previous year
5
A node koajs
middleware which add no-cache related headers for all the koajs
response to disable caches.
It is useful for REST API response, add no-cache headers to avoid browsers cache request response. Only GET
response have no-cache headers by default.
The following headers are added to response header:
Cache-Control: no-cache, no-store, must-revalidate, proxy-revalidate
Expires: 0
Pragma: no-cache
Surrogate-Control: no-store
npm install koajs-nocache
nocache(options):
/**
* nocache middleware.
*
* @param {Object} [options]
* - {String|Array} methods need add nocache headers.
* default is ['GET']
*
* @return {Function} nocache middleware
*/
Add no-cache related headers to all the GET
responses:
const nocache = require('koajs-nocache');
app = new Koa();
app.use(nocache());
or use you can only add no-cache headers to specific requests with koa-router
:
const nocache = require('koajs-nocache');
router.get('/foo',
nocache(),
function(ctx, next) {
ctx.body = ...;
});
Checkout test/nocache_test.js
for example usages.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 2/14 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More