Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amplication/plugin-cache-redis

Package Overview
Dependencies
Maintainers
8
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplication/plugin-cache-redis

Use Redis as a Cache in services generated with Amplication

  • 2.0.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
17K
decreased by-53.08%
Maintainers
8
Weekly downloads
 
Created
Source

@amplication/plugin-cache-redis

NPM Downloads

Use a Redis cache in the service generated by Amplication.

Purpose

This plugin adds the required code to use Redis as a cache in the service generated by Amplication.

It updates the following parts:

  • Adds the required dependencies to package.json.
  • Adds the required environment variables to .env.
  • Adds the CacheModule configured to use Redis to the app.module.ts module imports list.
  • Adds the required service to the docker-compose.yml file.

Configuration

The host setting is the host of the Redis server.

The port setting is the port on which the Redis server is accepting connections.

The ttl setting is the Time To Live for cached values.

The max setting is the maximum amount of requests that can be cached at once.

The username setting is the username used to connect to the server.

The password setting is the password used to connect to the server.

If no configuration is provided the .amplicationrc.json file will use be used as the default values.

{
  "host": "localhost",
  "port": 6379,
  "ttl": 5000,
  "username": null,
  "password": null
}

Scripts

build

Running npm run build will bundle your plugin with Webpack for production.

dev

Running npm run dev will watch your plugin's source code and automatically bundle it with every change.

test

Running npm run test will run the plugin's test suite.

Usage

This plugin provides you with a Redis cache module that you can use in your service as described here: https://docs.nestjs.com/techniques/caching#interacting-with-the-cache-store.

To configure, set the following environment variables:

REDIS_HOST - The host on which the Redis server is running.

REDIS_PORT - The port on which the Redis server is listening.

REDIS_TTL - The default Time To Live, in milliseconds, for cached requests on the Redis server.

REDIS_USERNAME - The username to be used to connect to the Redis server.

REDIS_PASSWORD - The password to be used to connect to the Redis server.

FAQs

Package last updated on 28 Dec 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc