performance-audit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePerformance Audit
性能审计
Find what makes a site slow to load and fix it by template: render-blocking resources, the largest image, oversized scripts and images, missing compression and caching, slow server response, font loading and layout shift.
squirrelscan's performance rules read the page's markup, headers and fetched resources. They flag the causes behind Core Web Vitals; they are not real-user measurements. Google's thresholds, judged at the 75th percentile of field data, are: Largest Contentful Paint 2.5 s or less, Interaction to Next Paint 200 ms or less, Cumulative Layout Shift 0.1 or less (https://web.dev/articles/vitals). To confirm a fix moved real users, the user needs field data (the Chrome UX Report or PageSpeed Insights).
找出导致网站加载缓慢的原因,并按模板进行修复:阻塞渲染的资源、最大图片、超大脚本和图片、缺失的压缩与缓存、服务器响应缓慢、字体加载和布局偏移。
squirrelscan 的性能规则会读取页面的标记、响应头和已获取资源。它们会指出导致 Core Web Vitals 指标异常的根本原因;这些结果并非真实用户测量数据。Google 的阈值依据现场数据(field data)的第 75 百分位判定:Largest Contentful Paint 不超过 2.5 s,Interaction to Next Paint 不超过 200 ms,Cumulative Layout Shift 不超过 0.1(https://web.dev/articles/vitals)。要确认某项修复是否改善了真实用户体验,用户需要现场数据(Chrome UX Report 或 PageSpeed Insights)。
Before the first audit
首次审计前
Run . If it fails, install the CLI from squirrelscan.com/download (the skill has ). Then run :
squirrel --versionsquirrelscanreferences/install.mdsquirrel auth status- Signed out, or : the audit runs on this machine, is free, and nothing is published.
--offline - Signed in: the audit is billed in credits (50 plus 2 per audited page, plus 1 per distinct external link the cloud verifies), adds the site to the user's dashboard, can turn on recurring audits and publishes an unlisted report. Tell the user the cost () and get a yes. Offer
squirrel creditsor--offline. For a site the user does not own, add--no-publish: nothing is added to the dashboard, scheduled or published.--ephemeral
Every flag below is checked against the squirrel CLI docs (https://docs.squirrelscan.com/cli/audit). Rule docs: .
https://docs.squirrelscan.com/rules/{category}/{rule_id}运行 。如果失败,请从 squirrelscan.com/download 安装 CLI( skill 中包含 )。然后运行 :
squirrel --versionsquirrelscanreferences/install.mdsquirrel auth status- **未登录,或使用 :**审计将在本机运行,免费,且不会发布任何内容。
--offline - **已登录:**审计将消耗 credits(基础费用为 50 credits,每个受审计页面另加 2 credits,云端验证的每个不同外部链接另加 1 credit),将站点加入用户的面板,可启用定期审计,并发布一份非公开报告。请告知用户费用(),并获得其明确同意。可以提供
squirrel credits或--offline。对于用户并不拥有的网站,添加--no-publish:不会将站点加入面板、安排定期审计或发布报告。--ephemeral
下面使用的每个 flag 都已依据 squirrel CLI 文档核对(https://docs.squirrelscan.com/cli/audit)。规则文档:`https://docs.squirrelscan.com/rules/{category}/{rule_id}`。
Run it
运行
bash
squirrel audit https://example.com --level surface \
--rule-include perf,images --format json -o perf.json- Audit the live site: only there do compression, caching, HTTP version and server response times reflect production. A local dev server shows development bundles.
- covers one page per template, which is what performance work needs. Add
surfacefor sign-off.--level full - Read the category score:
perf.squirrel report <audit-id> --group performance --format llm
bash
squirrel audit https://example.com --level surface \
--rule-include perf,images --format json -o perf.json- 审计线上站点:只有针对线上站点进行审计,压缩、缓存、HTTP 版本和服务器响应时间才会反映生产环境情况。本地开发服务器显示的是开发构建产物。
- 级别会覆盖每个模板中的一个页面,这正是性能工作所需的范围。签核时添加
surface。--level full - 读取 类别得分:
perf。squirrel report <audit-id> --group performance --format llm
Fix order (biggest effect first)
修复顺序(先处理影响最大的)
- Loading the main content: ,
perf/lcp-hints,perf/lcp-fetchpriority,perf/lazy-above-fold,perf/render-blocking,perf/critical-request-chains,perf/preconnect.perf/ttfb - Bytes: ,
perf/total-byte-weight,perf/js-file-size,perf/css-file-size,perf/duplicate-js,perf/legacy-js,perf/unminified-js,perf/unminified-css,perf/content-in-js-bundle,perf/framework-data-payload,images/image-file-size,images/modern-format.images/responsive-size - Delivery: ,
perf/compression,perf/asset-compression,perf/cache-headers,perf/bad-caching.perf/http2 - Stability and responsiveness: ,
perf/cls-hints,images/dimensions,perf/font-loading,perf/font-delivery,perf/inp-hints.perf/dom-size - Hygiene: ,
perf/source-maps,perf/js-libraries,perf/js-redirects,images/lazy-loading.images/offscreen-lazy
Do not lazy-load the main (largest) image: the audit flags that, and it is a common regression. Get each rule's exact fix from its docs page.
- 加载主要内容:、
perf/lcp-hints、perf/lcp-fetchpriority、perf/lazy-above-fold、perf/render-blocking、perf/critical-request-chains、perf/preconnect。perf/ttfb - 资源体积:、
perf/total-byte-weight、perf/js-file-size、perf/css-file-size、perf/duplicate-js、perf/legacy-js、perf/unminified-js、perf/unminified-css、perf/content-in-js-bundle、perf/framework-data-payload、images/image-file-size、images/modern-format。images/responsive-size - 传输:、
perf/compression、perf/asset-compression、perf/cache-headers、perf/bad-caching。perf/http2 - 稳定性与响应性:、
perf/cls-hints、images/dimensions、perf/font-loading、perf/font-delivery、perf/inp-hints。perf/dom-size - 基础清理:、
perf/source-maps、perf/js-libraries、perf/js-redirects、images/lazy-loading。images/offscreen-lazy
不要对主图(最大图片)使用懒加载:审计会将此标记为问题,而且这是常见的性能回退。每条规则的具体修复方法请参阅其文档页面。
Where the fix usually lives
修复通常位于哪里
| Stack | Look here |
|---|---|
| Next.js | |
| WordPress | one caching plugin (not several), an image optimization plugin or service, removing unused plugins and page-builder widgets, theme scripts loading on every page, a CDN |
| Shopify | theme assets and Liquid, uninstalling apps (each can inject scripts; removing the app may leave code in |
| Webflow | image settings and formats, removing unused interactions and custom code, font loading settings |
| Cloudflare | caching rules and cache TTLs, compression (Brotli), HTTP/2 and HTTP/3, image resizing |
| Vercel / Netlify | |
| 技术栈 | 优先检查 |
|---|---|
| Next.js | |
| WordPress | 一个缓存插件(不要使用多个)、图片优化插件或服务、移除未使用的插件和页面构建器小部件、每个页面都会加载的主题脚本、CDN |
| Shopify | 主题资源和 Liquid、卸载应用(每个应用都可能注入脚本;卸载应用后,代码仍可能留在 |
| Webflow | 图片设置和格式、移除未使用的交互和自定义代码、字体加载设置 |
| Cloudflare | 缓存规则和缓存 TTL、压缩(Brotli)、HTTP/2 和 HTTP/3、图片调整 |
| Vercel / Netlify | 为带哈希的资源设置 |
Prove it
验证改进
Re-audit with after the deploy (cached pages would show the old numbers), then compare with the baseline: . Report the before and after score and the specific rules that cleared.
--refreshsquirrel report --diff <baseline-audit-id> --format llm部署后,使用 重新审计(缓存页面会显示旧数值),然后与基线进行比较:。报告修复前后的得分以及已清除的具体规则。
--refreshsquirrel report --diff <baseline-audit-id> --format llmStop condition
停止条件
Stop when error-severity findings are cleared on a re-audit, the remaining warnings are listed with their cost and effort, and the user has been told lab-style checks do not replace field data. To stop it regressing, see ( style gates).
perf--level fullwebsite-ci-gate--fail-on 'score:perf<80'当 重新审计后,严重级别为错误的 检查结果均已清除,列出剩余警告及其成本和工作量,并告知用户实验室检查(lab-style checks)不能替代现场数据(field data)时,停止本次修复。为防止问题再次出现,请参阅 (类似 的门禁)。
--level fullperfwebsite-ci-gate--fail-on 'score:perf<80'Hand off
交接
Broken assets and links: . Anything else, and the fix loop: .
broken-link-checkeraudit-website损坏的资源与链接:。其他问题以及整个修复循环:。
broken-link-checkeraudit-website