cache-components
vercel · Development
专家级指导 Next.js 缓存组件与部分预渲染(PPR)。 **主动激活**:在 Next.js 项目中检测到 next.config.ts/next.config.js 中启用 `cacheComponents: true` 时,自动应用缓存组件模式与最佳实践,指导所有 React Server Component 实现。 **检测机制**:在启动 Next.js 项目会话时,检查 next.config. 是否启用 `cacheComponents: true`。若启用,则本技能的模式应指导所有组件编写、数据获取和缓存决策。 **使用场景**:实现 'use cache' 指令,使用 cacheLife() 配置缓存生命周期,使用 cacheTag() 标记缓存数据,使用 updateTag()/revalidateTag() 无效化缓存,优化静态与动态内容边界,调试缓存问题,审查缓存组件实现。
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/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **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, and reviewing Cache Component implementations.
npx skills add https://github.com/vercel/next.js --skill cache-components
星标 139957 · 安装量 0