Gathering detailed insights and metrics for upcache
Gathering detailed insights and metrics for upcache
Gathering detailed insights and metrics for upcache
Gathering detailed insights and metrics for upcache
npm install upcache
Typescript
Module System
Node Version
NPM Version
73.1
Supply Chain
97
Quality
75.3
Maintenance
50
Vulnerability
98.6
License
JavaScript (83.95%)
Lua (13.41%)
Dockerfile (1.7%)
Makefile (0.93%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
20,508
Last Day
2
Last Week
44
Last Month
152
Last Year
2,753
15 Stars
432 Commits
1 Forks
2 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
2.8.2
Package Id
upcache@2.8.2
Unpacked Size
108.89 kB
Size
24.61 kB
File Count
45
NPM Version
9.2.0
Node Version
18.19.1
Publised On
13 Apr 2024
Cumulative downloads
Total Downloads
Last day
-66.7%
2
Compared to previous day
Last week
-12%
44
Compared to previous week
Last month
-23.2%
152
Compared to previous month
Last year
-16.9%
2,753
Compared to previous year
3
Caching proxy having cache keys configured by the upstream application, by setting http response headers.
Upcache has several ways of changing the cache keys:
Breaking change: server.d/upcache.conf is now server.d/upcache-memcached.conf
In debian/12 these packages are easy to install:
nginx
libnginx-mod-http-srcache-filter
libnginx-mod-http-set-misc
libnginx-mod-http-memc (if using memcached, or for running the test suite
memcached or redis
lua-resty-core
lua-resty-lrucache
a Node.js express app
The Node.js app need the module
1npm install upcache
The nginx configuration need the module
1luarocks install upcache
nginx is easily configured with the set of files described in (depending on
where npm installs the module) ./node_modules/upcache/nginx/README.md
.
Once installed, load appropriate helpers with
1const app = express(); 2const { tag, lock } = require('upcache'); 3const mlock = lock(config); 4 5app.get('/route', tag('ugc', 'global'), mlock.restrict('logged'), ...); 6app.post('/route', tag(), mlock.restrict('logged'), ...); 7
See README-tag.md and README-lock.md for documentation, and test/ for more examples.
Mind that srcache
module honours cache control headers - if the application
sends responses with Cache-Control: max-age=0
, the resource is not cached,
and tag().for()
is a facility for doing cache control.
To cache something, resources must be tagged, so lock/vary won't work without tag.
Upcache adds a X-Upcache: <version>
header to requests, so upstream application
can detect it is enabled, and which features are available.
A pre-configured nginx environment is available for testing a Node.js application that listens on port 3000, with nginx on port 3001 and memcached on port 3002, simply by launching (depending on ./node_modules/.bin being on PATH or not)
1npm run upcache
which also has an option for filtering output -g <regexp pattern>
.
mocha
relies on it for integration tests. No root permissions are needed.
See LICENSE file.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
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
dependency not pinned by hash detected -- score normalized to 0
Details
Score
Last Scanned on 2025-02-03
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