Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: tests
on: [push, pull_request]

jobs:
testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Environment (Using NodeJS 16.x)
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Install dependencies
run: npm install

- name: Linting
run: npx standard

- name: Run tests
run: npm run test
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const middleware = (opts) => async (req, res, next) => {
return acc
}, [])
// delete keys on all cache tiers
patterns.forEach(pattern => opts.stores.forEach(store => getKeys(store, pattern).then(keys => mcache.del(keys))))
patterns.forEach(pattern => opts.stores.forEach(store => getKeys(store, pattern).then(keys => keys.length > 0 ? mcache.del(keys) : null)))
} else if (payload.headers[X_CACHE_TIMEOUT] || payload.headers[CACHE_CONTROL]) {
// extract cache ttl
let ttl = 0
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@
},
"homepage": "https://github.com/jkyberneees/http-cache-middleware#readme",
"devDependencies": {
"chai": "^4.3.4",
"got": "^11.8.2",
"mocha": "^8.4.0",
"cache-manager-ioredis": "^2.1.0",
"chai": "^4.3.6",
"got": "^11.8.5",
"mocha": "^10.0.0",
"nyc": "^15.1.0",
"restana": "^4.9.1"
"restana": "^4.9.6"
},
"dependencies": {
"@tusbar/cache-control": "^0.5.0",
"cache-manager": "^3.4.4",
"@tusbar/cache-control": "^0.6.1",
"cache-manager": "^4.0.1",
"matcher": "^4.0.0",
"middleware-if-unless": "^1.2.5",
"middleware-if-unless": "^1.3.0",
"ms": "^2.1.3",
"on-http-end": "^1.0.2"
}
Expand Down