New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@innovixx/payload-next-cache-revalidate-plugin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@innovixx/payload-next-cache-revalidate-plugin

plugin for Payload CMS that calls Next.js revalidation endpoints to clear the server-side cache, ensuring that users receive the most up-to-date content.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Payload Next Cache Revalidate Plugin

A plugin for https://github.com/payloadcms/payload that calls Next.js revalidation endpoints to clear the server-side cache, ensuring that users receive the most up-to-date content.

Core Features:

  • Revalidate cache for specified collections
  • Supports dynamic URL generation for revalidation endpoints

Installation

pnpm add @innovixx/payload-next-cache-revalidate-plugin
# OR
npm i @innovixx/payload-next-cache-revalidate-plugin

Basic Usage

import { payloadNextCacheRevalidatePlugin } from '@innovixx/payload-next-cache-revalidate-plugin';

const payloadConfig = {
	...
  plugins: [
    payloadNextCacheRevalidatePlugin({
      collections: [
        'page',
      ],
      generateUrl: async ({ doc, collectionConfig, req }) => {
        switch (collectionConfig.slug) {
          default:
          case 'page': {
            return `${process.env.CLIENT_URL}/revalidate?path=/${doc.slug}`;
          }
        }
      },
    }),
  ],
	...
};

Development

To actively develop or debug this plugin, you can either work directly within the demo directory of this repo or link your own project.

Internal Demo

This repo includes a fully working, self-seeding instance of Payload that installs the plugin directly from the source code. This is the easiest way to get started. To spin up this demo, follow these steps:

  • First, clone the repo
  • cd YOUR_PLUGIN_REPO && pnpm && pnpm watch
  • cd YOUR_PLUGIN_REPO/demo && pnpm && pnpm cleanDev
  • Now open http://localhost:3000/admin in your browser
  • Enter username admin@innovixx.co.uk and password Pa$$w0rd!

That's it! Changes made in ./src will be reflected in your demo.

Keywords

payload

FAQs

Package last updated on 24 Apr 2025

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