1.0.4 • Published 4 months ago

@spurtcommerce/redis-cache v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

@spurtcommerce/redis-cache

šŸ”„ Effortless Redis-based API caching for Express.js

This package allows you to cache specific API responses in Redis with minimal configuration. Just plug it in, specify your routes and TTLs (in seconds), and you're good to go — Boom! Cache is integrated.


✨ Features

  • Super easy to integrate
  • Route-specific TTL configuration
  • Global middleware for clean architecture
  • Powered by Redis

šŸ“¦ Installation

npm install @spurtcommerce/redis-cache

Sample Code

import { initRedis, cacheMiddleware } from '@spurtcommerce/redis-cache';

await initRedis(REDIS_URL);

app.use(
    cacheMiddleware({       // Mention the Reqiured Api path to cache with duration in seconds
        '/api/list/banner': 5,
        '/api/list/language': 5,
        '/api/pages': 5,
        '/api/list/blog/blog-list': 5,
    })
);
1.0.4

4 months ago

1.0.3

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago