npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

next-paylaod-handler

v0.1.3

Published

Custom handling of Next.js RSC payloads.

Readme

next-payload-handler · MIT License

next-payload-handlerNext.js의 payload cache key-value를 Redis에 저장하고 관리할 수 있는 라이브러리입니다.
Next.js의 캐시 키를 커스텀하고, 이를 Next.js 서버뿐만 아니라 백엔드/BFF 서버에서도 핸들링할 수 있도록 도와줍니다.

설치

npm install next-payload-handler

특징

  • Next.js의 payload key-value를 Redis에 저장
    • Next.js의 fetch cache key 및 payload 데이터를 Redis에 저장하여, 분산된 환경에서도 일관된 캐싱을 유지할 수 있습니다.
  • 커스텀 키 지원 (fetch 옵션의 tag 사용)
    • fetch()tags 옵션을 활용하여 캐시 키를 커스텀 가능.
    • Next.js 서버가 아닌 백엔드/BFF 서버에서도 Next.js의 캐시를 핸들링할 수 있습니다.
  • 간편한 설정
    • Redis 정보만 설정하면 바로 사용할 수 있습니다.
    • 기존 Next.js 프로젝트에 간단하게 추가 가능.

사용법

next config 설정

// next.config.js
const nextConfig = {
  cacheHandler: require.resolve("./cache-handler.mjs"),
  cacheMaxMemorySize: 0,
};

module.exports = nextConfig;

redis 연결

// cache-handler.mjs
import PayloadCacheHandler from 'next-paylaod-hanlder';

class CustomCacheHandler extends PayloadCacheHandler {
  constructor() {
    super({
      socket: { host: "127.0.0.1", port: 6379 }
    });
  }
}

export default CustomCacheHandler;

커스텀 캐시 키 설정

fetch('/api/data', {
  next: { tags: ['custom-key'] },
});

캐시 키 관리 (BFF/백엔드에서 캐시 삭제)

redisClient.del('custom-key')