Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计通过

cache-components缓存组件

Agent Skill

cache-components 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

318

周安装

13

GitHub Stars

208

下载量

102
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cache-components(缓存组件)
来源仓库:https://github.com/first-fluke/fullstack-starter
仓库路径:skills/cache-components
安装命令:
npx skills add https://github.com/first-fluke/fullstack-starter --skill cache-components
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/first-fluke/fullstack-starter --skill cache-components

简介

cache-components 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词或任务场景快速定位候选结果。
  • 通过 npx skills add 命令从指定仓库安装,需确认权限和维护状态。
  • 使用前建议核验是否会触发联网、命令执行或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Expert guidance for Next.js Cache Components and Partial Prerendering (PPR).

PROACTIVE ACTIVATION: Use this skill automatically when working in Next.js projects that have cacheComponents: true in their next.config.ts or next.config.js.

DETECTION: At the start of a session in a Next.js project, check for cacheComponents: true in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions.

USE CASES:

  • Implementing 'use cache' directive
  • Configuring cache lifetimes with cacheLife()
  • Tagging cached data with cacheTag()
  • Invalidating caches with updateTag() / revalidateTag()
  • Optimizing static vs dynamic content boundaries
  • Debugging cache issues
  • Reviewing Cache Component implementations

Project Detection

When starting work in a Next.js project, check if Cache Components are enabled:

# Check next.config.ts or next.config.js for cacheComponents
grep -r "cacheComponents" next.config.* 2>/dev/null

If cacheComponents: true is found, apply this skill's patterns proactively when:

  • Writing React Server Components
  • Implementing data fetching
  • Creating Server Actions with mutations
  • Optimizing page performance
  • Reviewing existing component code

Core Concept: The Caching Decision Tree

When writing a React Server Component, ask:

  1. Does it depend on request context? (cookies, headers, searchParams)
  2. Can this be cached? (Is the output the same for all users?)

- YES -> 'use cache' + cacheTag() + cacheLife() - NO -> Wrap in <Suspense> (dynamic streaming)

Philosophy: Code Over Configuration

Cache Components represents a shift from segment-based configuration to compositional code:

  • Before (Deprecated): export const revalidate = 3600
  • After: cacheLife('hours') inside 'use cache'
  • Before (Deprecated): export const dynamic = 'force-static'
  • After: Use 'use cache' and Suspense boundaries

Quick Start

1. Enable Configuration

// next.config.ts
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  experimental: {
    ppr: true,
    dynamicIO: true, // often correlated features
  },
  // Ensure basic cache components flag if required by your version
};

export default nextConfig;

2. Basic Usage

import { cacheLife } from 'next/cache';

async function CachedPosts() {
  'use cache'
  cacheLife('hours'); // Cache for hours

  const posts = await db.posts.findMany();
  return <PostList posts={posts} />;
}

Core APIs

'use cache'

Marks a function, component, or file as cacheable. The return value is cached and shared across requests.

cacheLife(profile)

Control cache duration using semantic profiles:

  • 'seconds': Short-lived
  • 'minutes': Medium-lived
  • 'hours': Long-lived
  • 'days': Very long-lived
  • 'weeks': Static-like content
  • 'max': Permanent cache

cacheTag(...tags)

Tag cached data for on-demand invalidation.

import { cacheTag } from 'next/cache';

async function getUserProfile(id: string) {
  'use cache'
  cacheTag('user-profile', `user-${id}`);
  // ... fetch logic
}

revalidateTag(tag) / expireTag(tag)

Invalidate cached data in background or immediately.

'use server'
import { expireTag } from 'next/cache';

export async function updateUser(id: string, data: any) {
  await db.user.update({ where: { id }, data });
  expireTag(`user-${id}`); // Invalidate specific cache
}

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.9%
按下载量换算30

Antigravity

23.59%
按下载量换算24

windsurf

17.96%
按下载量换算18

OpenCode

14.34%
按下载量换算15

Cursor

9.28%
按下载量换算9

Codex

3.7%
按下载量换算4

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills