{"id":21672088,"url":"https://github.com/momsfriendlydevco/express-middleware-cache","last_synced_at":"2026-04-09T21:48:45.668Z","repository":{"id":78689328,"uuid":"107134262","full_name":"MomsFriendlyDevCo/express-middleware-cache","owner":"MomsFriendlyDevCo","description":"Express caching middleware using Memory/MemcacheD/Mongo","archived":false,"fork":false,"pushed_at":"2024-04-08T01:48:01.000Z","size":45,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-02T03:39:00.568Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MomsFriendlyDevCo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-10-16T13:53:19.000Z","updated_at":"2022-05-23T00:47:07.000Z","dependencies_parsed_at":"2025-06-30T05:04:58.425Z","dependency_job_id":"d55bef22-464c-46f2-9300-fe0c12e51322","html_url":"https://github.com/MomsFriendlyDevCo/express-middleware-cache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MomsFriendlyDevCo/express-middleware-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fexpress-middleware-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fexpress-middleware-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fexpress-middleware-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fexpress-middleware-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MomsFriendlyDevCo","download_url":"https://codeload.github.com/MomsFriendlyDevCo/express-middleware-cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fexpress-middleware-cache/sbom","scorecard":{"id":95745,"data":{"date":"2025-08-11","repo":{"name":"github.com/MomsFriendlyDevCo/express-middleware-cache","commit":"5afc44a8173162fed17b57ef426c2ea57917776c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"34 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-f825-f98c-gj3g","Warn: Project is vulnerable to: GHSA-h8hf-x3f4-xwgp","Warn: Project is vulnerable to: GHSA-9m93-w8w6-76hh","Warn: Project is vulnerable to: GHSA-m7xq-9374-9rvx","Warn: Project is vulnerable to: GHSA-vg7j-7cwx-8wgw","Warn: Project is vulnerable to: GHSA-p92x-r36w-9395","Warn: Project is vulnerable to: GHSA-45q2-34rf-mr94","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-35q2-47q7-3pc3","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T08:59:24.214Z","repository_id":78689328,"created_at":"2025-08-15T08:59:24.214Z","updated_at":"2025-08-15T08:59:24.214Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000704,"owners_count":26082805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T13:17:12.290Z","updated_at":"2025-10-08T19:25:13.321Z","avatar_url":"https://github.com/MomsFriendlyDevCo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"@MomsFriendlyDevCo/express-middleware-cache\n===========================================\nExpress middleware for caching the result of a server action in-memory, MongoDB or MemcacheD.\n\n\nFeatures:\n\n* Easy to use syntax - Specify cache times in shorthand durations such as `app.get('/some/api', cache('1h'), (req, res) =\u003e ...)`\n* Cache invalidation - Provide a tag for your cache setup and quickly invalidate all matching routes if necessary\n* Etag support - Allows the client to make a request by the server generated hash and recieve either a code 200 (with data) or a 304 (Not Modified) response without actually making a full request\n* Pluggable interface - Not just in-memory storage! Add any FIXME plugin to hold cache contents over server restarts\n\n\n\nSimple example\n--------------\n\n```javascript\nvar cache = require('@momsfriendlydevco/route-cache');\n\n// Setup the cache (configure which modules to try etc.)\nawait util.promisify(cache.setup)();\n\n// This route should cache for about about 30 seconds\napp.get('/some/api/hourly', cache('30s'), (req, res) =\u003e ...)\n\n// This route should cache for about a minute and a half\napp.get('/some/api/hourly', cache('1m30s'), (req, res) =\u003e ...)\n\n// This route should cache for an hour\napp.get('/some/api/hourly', cache('1h'), (req, res) =\u003e ...)\n```\n\n\nCache invalidation\n------------------\nWhen setting up a cache specify `tag` / `tags` and invalidate against them when you want all calls to that route to be refreshed.\n\n```javascript\n// Make a route which only gets refreshed every hour\n\napp.get('/some/api', cache('1h', {tag: 'myApi'}), (req, res) =\u003e ...)\n\n\n// Later after some action which requires a cache reset:\n\ncache.invalidate('myApi');\n```\n\n\nAPI\n===\n\ncache.defaults\n--------------\nObject containing any future caching objects options.\n\nSupported options:\n\n| Option           | Type               | Default                       | Description                                                                                       |\n|------------------|--------------------|-------------------------------|---------------------------------------------------------------------------------------------------|\n| `duration`       | `string`           | `1h`                          | Default duration to cache for                                                                     |\n| `cache`          | `object`           | `{}`                          | Options passed to [@momsfriendlydevco/cache](https://github.com/MomsFriendlyDevCo/generic-cache) to setup a cache instance |\n| `hashObject`     | `function`         | See internals                 | Method which returns the hashable object to use as the key in the cache. Defaults to hashing `req.{method,path,query,body}` |\n| `tag`            | `string` / `array` | `''`                          | Optional tag or tags to associate with the cache. These can be used to invalidate the cache later. If any member is a function it is called as `(req, res)` and expected to return a string |\n| `tags`           | `string` / `array` | `''`                          | Alias of `tag`                                                                                    |\n| `etag`           | `boolean`          | `true`                        | Use eTag compatible caching with backend (only refresh when the server eTag doesn't match)        |\n| `generateEtag`   | `function`         | See internals                 | Callback-style function used to generate an eTag value. Called as `(cb, hash, settings)`          |\n| `subscribe`      | `boolean`          | `true`                        | Subscribe the returned EMC instance to the `emc.events` eventEmitter to react to gloabl events such as calls to `emc.invalidate()` |\n| `tagStorePrefix` | `string`           | `\"emc-tagstore\"`              | Prefix to use when caching tagStore collections                                                   |\n| `cacheQuery`     | `function`         | `(req, res, content) =\u003e true` | Replacable function used to determine if the request should be cached. Replacing this with `(req, res) =\u003e res.statusCode == 200` would only cache 200 codes for example |\n\n\n\ncache(duration, options)\n------------------------\nThe basic cache factory. This function returns Express middleware tuned to the duration and options specified.\n\nOptions extend `cache.defaults`.\n\n\ncache.setup(options, [callback])\n--------------------------------\nInitial setup function. This must be called before the caching system can actually be used.\n\nYou can also pass in options that override the defaults.\n\n\ncache.invalidate(...tags)\n-------------------------\nReset the caching of any cache matching the given tag, array of tags or multiple tags.\n\n\ncache.ready\n-----------\nBoolean indicating if `cache.setup()` has finished its processing.\n\n\ncache.events\n------------\nAn `EventEmitter` instance which can be bound to in order to retrieve events.\n\nEvents fired:\n\n| Event                         | Called as     | Description                                                                              |\n|-------------------------------|---------------|------------------------------------------------------------------------------------------|\n| `routeCacheHit`               | `(req)`       | Fired when a route is requested that is handled by route-cache                           |\n| `routeCacheHashError`         | `(err, req)`  | Fired when a route hashing system fails                                                  |\n| `routeCacheEtag`              | `(req, info)` | The client requested the current hash via the `etag` header and will be served a 304 \"Not Modified\" response |\n| `routeCacheExisting`          | `(req, info)` | Fired when a route is requested, a cached version exists and will be provided instead of recomputing the result |\n| `routeCacheFresh`             | `(req, info)` | Fired when a route is requested, a valid cache does not exist and we need to compute the result |\n| `routeCacheInvalidate`        | `(tag, hash)` | Fired when a single tag is invalidated                                                   |\n| `routeCacheCacher`            | `(driver)`    | Emitted when the upstream Cache has loaded along with the driver ID that was used        |\n| `routeCacheInvalidateRequest` | `(...tags)` | Fired by `emc.invalidate()` to all upstream EMC objects to tell them to invalidate the given tags |\n\nThe info object contains the following structure:\n\n| Key       | Type      | Description                                                            |\n|-----------|-----------|------------------------------------------------------------------------|\n| `isFresh` | `boolean` | Whether the cache response was generated for this specific request     |\n| `hash`    | `string`  | The internal, unqiue hashing value used to identify this cache session |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomsfriendlydevco%2Fexpress-middleware-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmomsfriendlydevco%2Fexpress-middleware-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomsfriendlydevco%2Fexpress-middleware-cache/lists"}