Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Npm client persistent cache #28

Merged
merged 2 commits into from
Apr 5, 2018
Merged

Npm client persistent cache #28

merged 2 commits into from
Apr 5, 2018

Conversation

davisjam
Copy link
Owner

@davisjam davisjam commented Apr 5, 2018

No description provided.

Problem:
HTTP queries are slow.
We want to make as few as possible.
The existing memory-only cache does not persist across different
instantiations of the module, so we forget things.

Solution:
Introduce a persistent cache. This is now the default.

Details:
The cache lives in os.tmpdir().
The expected use case is on a developer's machine, where the
same projects will be queried over and over.
Any previously-answered queries will be resolved locally.
Only newly/recently-added regexes need contact the server.

Cached results do not expire.
If we add new detectors or otherwise change the definition of vulnerability
on the server side, we should add expiration into the client-side cache.

Fix:
This fixes #26.
@davisjam davisjam merged commit 9342146 into master Apr 5, 2018
@davisjam davisjam deleted the NPMClient-PersistentCache branch April 12, 2018 19:34
@davisjam davisjam mentioned this pull request May 1, 2018
6 tasks
jamesdonoh pushed a commit to jamesdonoh/vuln-regex-detector that referenced this pull request Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant