Amplication
Platform
Solutions
Learn
Star Us 16K
Log In to Amplication

Contact us

  • contact@amplication.org
Try Overcut.ai
v3.14.0Enterprise
  • Home /
  • Plugins /
  • Redis Cache
plugin logo
Redis Cache
Install Plugin

@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.

Details
npm
@amplication/plugin-cache-redis
github
https://github.com/amplication/plugins/tree/master/plugins/cache-redis
Installs
1
Categories
Cache
Documentation
https://github.com/amplication/plugins/tree/master/plugins/cache-redis#readme

Get started with Amplication and Redis Cache

Start NowBook a demo

Platform

Live TemplatesPluginsJovu

Solutions

Enhance platform engineeringBuild new servicesBuild APIs on existing DBModernize applications

Customers

IT ServicesRetailHealthcareManufacturingCustomer stories

Use Amplication

Get started Custom pluginsCustom codeSync with GitEvent-driven architectureBreak the monolith

Resources

DocsCustomer storiesPlugins catalogDiscord communityGitHubBlog

About

CompanyContact us

©2025 amplication

Privacy PolicyTerms & Conditions
Follow usTwitter IconYouTube Icon