Loading...
Loading...
Compare original and translation side by side
| Use this skill when... | Use another approach when... |
|---|---|
| Configuring content hashing for Next.js or Vite builds | Optimizing server-side caching (nginx, CDN config directly) |
| Setting up CDN cache headers for Vercel or Cloudflare | Debugging build output issues (system-debugging agent) |
| Verifying cache-busting compliance after a framework upgrade | Configuring general CI/CD workflows ( |
| Adding build verification scripts for hashed assets | Setting up container builds ( |
| Auditing static asset caching strategy across a project | Profiling frontend performance (browser devtools) |
| 适用场景 | 适用其他方案的场景 |
|---|---|
| 为Next.js或Vite构建配置内容哈希 | 优化服务器端缓存(直接配置Nginx、CDN) |
| 为Vercel或Cloudflare设置CDN缓存头 | 调试构建输出问题(使用系统调试Agent) |
| 框架升级后验证缓存击穿合规性 | 配置通用CI/CD工作流( |
| 为哈希资源添加构建验证脚本 | 配置容器构建( |
| 审计项目中静态资源的缓存策略 | 分析前端性能(使用浏览器开发者工具) |
pwdfind . -maxdepth 1 -name 'package.json' 2>/dev/nullfind . -maxdepth 1 -name 'next.config.*' 2>/dev/nullfind . -maxdepth 1 -name 'vite.config.*' 2>/dev/nullfind . -maxdepth 1 -type d \( -name '.next' -o -name 'dist' -o -name 'out' \) 2>/dev/nullfind . -maxdepth 1 \( -name 'vercel.json' -o -name '_headers' -o -name '_redirects' \) 2>/dev/null && find public -maxdepth 1 -name '_headers' 2>/dev/nullfind . -maxdepth 1 -name '.project-standards.yaml' 2>/dev/nullpwdfind . -maxdepth 1 -name 'package.json' 2>/dev/nullfind . -maxdepth 1 -name 'next.config.*' 2>/dev/nullfind . -maxdepth 1 -name 'vite.config.*' 2>/dev/nullfind . -maxdepth 1 -type d \( -name '.next' -o -name 'dist' -o -name 'out' \) 2>/dev/nullfind . -maxdepth 1 \( -name 'vercel.json' -o -name '_headers' -o -name '_redirects' \) 2>/dev/null && find public -maxdepth 1 -name '_headers' 2>/dev/nullfind . -maxdepth 1 -name '.project-standards.yaml' 2>/dev/null--check-only--fix--framework <nextjs|vite>--cdn <cloudflare|vercel|none>--check-only--fix--framework <nextjs|vite>--cdn <cloudflare|vercel|none>| Indicator | Framework | Config File |
|---|---|---|
| Next.js | |
| Next.js | |
| Vite | |
| Next.js (built) | Detection only |
| Vite (built) | Detection only |
package.json"next""vite"--framework| 识别标识 | 框架 | 配置文件 |
|---|---|---|
| Next.js | |
| Next.js | |
| Vite | |
| Next.js(已构建) | 仅用于检测 |
| Vite(已构建) | 仅用于检测 |
package.json"next""vite"--frameworknext.config.js/tsgenerateBuildIdassetPrefixcompress: truepoweredByHeader: falsegenerateEtagsheaders()vite.config.js/tsbuild.rollupOptions.output.entryFileNames[hash]build.rollupOptions.output.chunkFileNames[hash]build.rollupOptions.output.assetFileNames[hash]build.manifest: truebuild.cssCodeSplitnext.config.js/tsgenerateBuildIdassetPrefixcompress: truepoweredByHeader: falsegenerateEtagsheaders()vite.config.js/tsbuild.rollupOptions.output.entryFileNames[hash]build.rollupOptions.output.chunkFileNames[hash]build.rollupOptions.output.assetFileNames[hash]build.manifest: truebuild.cssCodeSplit| Indicator | CDN Provider |
|---|---|
| Vercel |
| Vercel |
| Cloudflare Pages |
| Cloudflare Pages / Netlify |
| Cloudflare Workers/Pages |
| None of the above | Generic / None |
| 识别标识 | CDN提供商 |
|---|---|
存在 | Vercel |
存在 | Vercel |
根目录或 | Cloudflare Pages |
存在 | Cloudflare Pages / Netlify |
存在 | Cloudflare Workers/Pages |
| 以上都不存在 | 通用/无CDN |
Cache-Busting Compliance Report
================================
Project: [name]
Framework: [Next.js 14.x | Vite 5.x]
CDN Provider: [Vercel | Cloudflare | None detected]
Framework Configuration:
Config file next.config.js [EXISTS | MISSING]
Asset hashing [hash] in filenames [ENABLED | DISABLED]
Build manifest manifest files [GENERATED | MISSING]
Deterministic builds Build ID configured [PASS | NOT SET]
Compression gzip/brotli enabled [PASS | DISABLED]
Cache Headers:
Static assets immutable, 1y [CONFIGURED | MISSING]
HTML files no-cache, must-revalidate [CONFIGURED | MISSING]
API routes varies by route [CONFIGURED | N/A]
CDN configuration vercel.json/_headers [EXISTS | MISSING]
Build Output (if built):
Hashed filenames app.[hash].js [DETECTED | NOT BUILT]
Content addressing Unique hashes per version [PASS | DUPLICATE]
Manifest integrity Valid manifest.json [PASS | INVALID]
Overall: [X issues found]
Recommendations:
[List specific fixes needed]--check-only缓存击穿合规性报告
================================
项目: [名称]
框架: [Next.js 14.x | Vite 5.x]
CDN提供商: [Vercel | Cloudflare | 未检测到]
框架配置:
配置文件 next.config.js [已存在 | 缺失]
资源哈希 文件名中包含[hash] [已启用 | 未启用]
构建清单 清单文件 [已生成 | 缺失]
确定性构建 已配置Build ID [通过 | 未设置]
压缩 已启用gzip/brotli [通过 | 未启用]
缓存头:
静态资源 immutable, 1y [已配置 | 缺失]
HTML文件 no-cache, must-revalidate [已配置 | 缺失]
API路由 因路由而异 [已配置 | 不适用]
CDN配置 vercel.json/_headers [已存在 | 缺失]
构建输出(若已构建):
哈希文件名 app.[hash].js [已检测到 | 未构建]
内容寻址 每个版本对应唯一哈希 [通过 | 重复]
清单完整性 有效的manifest.json [通过 | 无效]
总体情况: [发现X个问题]
建议:
[列出需要修复的具体内容]--check-onlynext.config.js/tsvite.config.js/tsnext.config.js/tsvite.config.js/tsvercel.jsonpublic/_headersvercel.jsonpublic/_headersscripts/verify-cache-busting.jspackage.jsonscripts/verify-cache-busting.jspackage.json.project-standards.yamlstandards_version: "2025.1"
last_configured: "[timestamp]"
components:
cache-busting: "2025.1"
cache-busting-framework: "[nextjs|vite]"
cache-busting-cdn: "[vercel|cloudflare|none]"
cache-busting-verified: true.project-standards.yamlstandards_version: "2025.1"
last_configured: "[时间戳]"
components:
cache-busting: "2025.1"
cache-busting-framework: "[nextjs|vite]"
cache-busting-cdn: "[vercel|cloudflare|none]"
cache-busting-verified: true| Context | Command |
|---|---|
| Quick compliance check | |
| Auto-fix all issues | |
| Next.js project only | |
| Vite project only | |
| Cloudflare CDN headers | |
| Vercel CDN headers | |
| 场景 | 命令 |
|---|---|
| 快速合规性检查 | |
| 自动修复所有问题 | |
| 仅针对Next.js项目 | |
| 仅针对Vite项目 | |
| Cloudflare CDN头配置 | |
| Vercel CDN头配置 | |
/configure:all/configure:status/configure:workflows/configure:dockerfile/configure:all/configure:status/configure:workflows/configure:dockerfile