跳到正文
Skillpedia
部署与云(DevOps)75k · #3064

ttfb

它能做什么

这项技能检查服务器开始响应访客请求的速度。适用于发现页面开始加载很慢、并希望服务器响应更快的开发者。

适用场景

  • ✓当页面在浏览器中出现任何内容之前需要很长时间的时候。
  • ✓当服务端渲染的页面或 API 的首次响应很慢的时候。
  • ✓当团队需要确认慢是来自服务器还是网络的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/ttfb/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/ttfb/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的网站要等很久才显示第一个内容。请帮我检查是不是服务器的问题?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会查看从请求到首次响应路径上的服务器处理、缓存和数据库工作。它会先把服务器时间与网络延迟区分开,然后再建议修改。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Reduce Time to First Byte (TTFB)

TTFB is the foundation of page performance; if the server is slow to respond, all subsequent loading stages are delayed.

Quick Reference

  • Optimize server-side logic and database queries to speed up response generation
  • Use a Content Delivery Network (CDN) to serve content closer to users
  • Implement effective caching strategies at the server and edge levels

Check

Review the page's TTFB and identify any bottlenecks in the server-side processing or network transmission.

Fix

Optimize the server's response time by improving database queries, caching responses, and using a CDN.

Explain

Explain how TTFB impacts the entire page load process and why it is a critical starting point for performance optimization.

Code Review

Review server-rendered routes, API handlers, cache configuration, and database access on the critical path. Flag uncached HTML, slow synchronous work before the first byte, repeated upstream fetches, or expensive queries that keep TTFB above roughly 800ms.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/performance/ttfb

常见问题

什么样的首次响应时间算好?

这项技能把超过约 800 毫秒的响应时间标记为需要关注。

CDN 能帮忙吗?

可以。这项技能建议使用内容分发网络(CDN),使内容从离用户更近的地方提供。

哪些常见原因会导致响应变慢?

它会查找的常见原因包括数据库查询慢、缺少缓存,以及重复的上游请求。

详情

作者的原始描述

Use when auditing slow first responses on SSR pages, APIs, or cacheable HTML. Distinguish origin compute time from network latency and CDN cache misses before proposing a fix.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#3064
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能