
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
@neshca/handler-redis
Advanced tools
The RemoteCacheHandler class is an implementation of the CacheHandler interface that uses a remote cache handler service to get, set, and revalidate cache entries. It sends HTTP POST requests to the remote service with the cache key, cache value, and reva
The RemoteCacheHandler class is an implementation of the CacheHandler interface that uses a remote cache handler service to get, set, and revalidate cache entries. It sends HTTP POST requests to the remote service with the cache key, cache value, and revalidated tags as JSON-encoded data.
To install the @neshca/handler-redis
package, run the following command:
npm install -D @neshca/handler-redis
npm install -D redis
Create a file called cache-handler.js
next to you next.config.js
with the following contents:
const { RemoteCacheHandler } = require('@neshca/handler-redis');
const { createClient } = require('redis');
const client = createClient({
url: process.env.REDIS_URL ?? 'redis://localhost:6379',
});
client.on('error', (err) => {
console.log('Redis Client Error', err);
});
RemoteCacheHandler.setRedisClient(client);
RemoteCacheHandler.setPrefix('app-name:');
RemoteCacheHandler.connect().then();
module.exports = RemoteCacheHandler;
Then, use the following configuration in your next.config.js
file:
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
incrementalCacheHandlerPath: require.resolve('./cache-handler'), // path to the cache handler file you created
isrFlushToDisk: false, // disable writing cache to disk
},
};
module.exports = nextConfig;
Use the REDIS_URL
environment variable to set the URL of your Redis instance. If the environment variable is not set, the default URL redis://localhost:6379 will be used
REDIS_URL=redis://localhost:6379/
For local development, you can use Docker to start a Redis instance with the following command:
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest
FAQs
The RemoteCacheHandler class is an implementation of the CacheHandler interface that uses a remote cache handler service to get, set, and revalidate cache entries. It sends HTTP POST requests to the remote service with the cache key, cache value, and reva
The npm package @neshca/handler-redis receives a total of 0 weekly downloads. As such, @neshca/handler-redis popularity was classified as not popular.
We found that @neshca/handler-redis 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.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.