Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
solr-client-cache
Advanced tools
This module is distributed using npm which comes bundled with node:
npm install --save solr-client-cache
const solr = require('solr-client');
const solrCache = require('solr-client-cache');
const client = solr.createClient();
solrCache(client, {
ttl: 60,
engine: 'redis',
host: '127.0.0.1',
port: 6379
});
// search Solr with cache
client
.cache()
.search(query, (err, results) => { /* ... */ });
// search Solr without cache
client
.search(query, (err, results) => { /* ... */ });
If you want a different TTL (Time to Live) for a specific query, then pass it to the cache()
function.
const solr = require('solr-client');
const solrCache = require('solr-client-cache');
const client = solr.createClient();
solrCache(client, { ttl: 60 });
// search Solr with cache
client
.cache(10) // 10 seconds TTL instead of 60s
.search(query, (err, results) => { /* ... */ });
All cache options (TTL, engine, etc...) are described on cacheman README.
Just run:
npm test
MIT
FAQs
Caching for Solr Client
The npm package solr-client-cache receives a total of 1 weekly downloads. As such, solr-client-cache popularity was classified as not popular.
We found that solr-client-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.