Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@kitten-team/koa-cache-proxy
Advanced tools
这个项目 fork 自koa-proxy,在保留原有 api 的基础上拓展了其他功能,原始 api 参考原文档,下文只描述改动的部分
npm install koa-cache-proxy -S
const proxy = require('koa-cache-proxy')
...
app.use(
proxy({
host: 'https://alicdn.com',
match: /^\/example(\/)?/,
hooks: [
{
path: '/example/LfkFyA2UCcsn8NIr', //随便起的一个url
handle(ctx) {
// do something
},
},
],
})
)
...
使用 hook 功能, hook 中定义的链接只会在 match 匹配的前提下生效
const proxy = require('koa-cache-proxy')
...
app.use(
proxy({
host: 'https://alicdn.com',
match: /^\/example(\/)?/,
cache: true //缓存所有,
// cache: /\.html$/ 缓存所有html结尾文件
// cache(path) { return false } 动态决定是否缓存
})
)
...
cache 缓存时会连同 response header 也一并缓存
使用此插件,在 koa 的 ctx 中将新增以下属性
ctx.path 是否符合缓存规则
Licensed under the MIT license.
1.0.3 (2018-09-10)
<a name="1.0.2"></a>
FAQs
Proxy middleware for koa
The npm package @kitten-team/koa-cache-proxy receives a total of 0 weekly downloads. As such, @kitten-team/koa-cache-proxy popularity was classified as not popular.
We found that @kitten-team/koa-cache-proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.