
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
payload-redis-cache-ssl
Advanced tools
This plugin for Payload CMS adds a cache layer to API endpoints. The cache is based on the combination of the user's collection and the original URL.
1.0.19
or higher is requiredTo install the plugin, run one of the following commands:
yarn add @aengz/payload-redis-cache
or
npm install @aengz/payload-redis-cache
You also need to install the redis package if it is not already installed:
yarn add redis
or
npm install redis
To use the plugin, add it to the Payload config as follows:
import { buildConfig } from 'payload/config';
import { cachePlugin } from '@aengz/payload-redis-cache'
const config = buildConfig({
// your config here
plugins: [
cachePlugin({
excludedCollections: ['users'],
// excludedGlobals: ['myglobal']
})
]
})
Add the initializer function in server.ts
import { cachePlugin } from '@aengz/payload-redis-cache'
...
initRedis({
redisUrl: process.env.REDIS_URI
})
Option | Type | Description |
---|---|---|
redisUrl * | string | Redis instance's url. |
redisNamespace | string | Choose the prefix to use for cache redis keys. Defaults to payload . |
redisIndexesName | string | Choose the index key for cache redis indexes. Defaults to payload-cache-index . |
excludedCollections | string[] | An array of collection names to be excluded. |
excludedGlobals | string[] | An array of globals names to be excluded. |
includedPaths | string[] | An array of custom routes to be included. |
A * denotes that the property is required.
This package provides utility functions for managing the cache. Here's an example of how to use the invalidateCache
function:
import { invalidateCache } from '@aengz/payload-redis-cache'
...
invalidateCache()
There is a development environment in the /dev
directory of the repository. To use it, create a new .env
file in the /dev
directory using the example .env.example
file as a reference:
cd dev
cp .env.example .env
Before using the plugin in the development environment, the package needs to be built. To build the library, run one of the following commands:
Build the lib using:
yarn dev:build
or
npm run dev:build
To run the development environment, use the following command:
yarn dev
or
npm run dev
To run the test suite, use one of the following commands:
yarn test
or
npm run test
FAQs
Redis cache plugin for Payload CMS with SSL
The npm package payload-redis-cache-ssl receives a total of 5 weekly downloads. As such, payload-redis-cache-ssl popularity was classified as not popular.
We found that payload-redis-cache-ssl demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.