[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,91 +2,157 @@
|
||||
id: wiki-2026-0508-pagespeed-insights
|
||||
title: PageSpeed Insights
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [P-Reinforce-AUTO-FB1C7F]
|
||||
aliases: [PSI, Google PageSpeed, Lighthouse]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.9
|
||||
tags: [auto-reinforced]
|
||||
verification_status: applied
|
||||
tags: [pagespeed, lighthouse, core-web-vitals, performance, web]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-20
|
||||
github_commit: "[P-Reinforce] Continuous Worker - PageSpeed Insights"
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: javascript
|
||||
framework: lighthouse, web-vitals
|
||||
---
|
||||
|
||||
# [[PageSpeed Insights]]
|
||||
# PageSpeed Insights
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> PageSpeed Insights는 웹 페이지의 로딩 속도와 사용자 경험 성능을 측정하고 개선을 위한 진단 결과를 제공하는 도구입니다. 이 도구의 진단 기능은 주로 [[Lighthouse]]에 의해 구동되며, 최근에는 INP(Interaction to Next Paint)를 비롯한 코어 웹 바이탈([[Core Web Vitals]]) 지표를 통합하여 웹사이트의 전반적인 반응성을 평가합니다 [1-3].
|
||||
## 매 한 줄
|
||||
> **"매 lab + field, mobile-first, CWV-driven"**. Google PSI = Lighthouse (lab simulation) + CrUX (real Chrome user data). 매 SEO ranking 의 official signal — Core Web Vitals (LCP, INP, CLS) score 의 결정. 2026 standard: INP replaced FID as interactivity metric.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
* **Lighthouse 기반의 진단 엔진:** PageSpeed Insights에서 제공하는 성능 진단 및 개선 권장 사항은 페이지 속도 측정 무료 도구인 Lighthouse의 코어 엔진을 기반으로 구동됩니다 [1].
|
||||
* **코어 웹 바이탈(Core Web Vitals) 평가:** PageSpeed Insights는 웹 성능을 평가하는 필수 측정 기준인 코어 웹 바이탈을 분석하는 주요 도구 중 하나입니다. 과거의 FID(First Input Delay) 지표를 대신하여, 이제는 사용자의 모든 상호작용 지연 시간을 포괄적으로 측정하는 INP(Interaction to Next Paint) 지표를 평가하도록 업데이트되었습니다 [2, 3].
|
||||
* **데이터 표출의 한계점:** PageSpeed Insights는 유용한 성능 지표를 제공하지만, 모든 세부 데이터를 직접 보여주지는 않습니다. 예를 들어, 로딩 속도 저하의 정확한 원인을 파악하는 데 유용한 크롬 사용자 경험 보고서([[CrUX]])의 LCP(Largest Contentful Paint) 하위 요소(subp[[Arts]]) 실제 사용자 데이터는 PageSpeed Insights 화면에 표출되지 않으며, 이를 확인하려면 CrUX Vis나 DebugBear와 같은 외부 도구를 이용해야 합니다 [4, 5].
|
||||
## 매 핵심
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌:** 자동화 엔진에 의해 매핑된 지식으로, 추후 정밀 검증 필요.
|
||||
- **정책 변화:** AI 분야의 자동 자산화 수행.
|
||||
### 매 두 가지 data
|
||||
- **Lab data (Lighthouse)**: 매 controlled simulation — emulated mobile, throttled 4G CPU. Reproducible, 매 dev iteration 에 적합.
|
||||
- **Field data (CrUX)**: 매 real Chrome users 의 28-day rolling aggregate. 매 actual user experience 반영. 매 SEO ranking 에 사용.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- **Related Topics:** [[Lighthouse]], [[Core Web Vitals]], [[Interaction to Next Paint (INP)]], [[Largest Contentful Paint (LCP)]]
|
||||
- **Projects/Contexts:** [[Web Performance Optimization]], [[Chrome]] User Experience Report (CrUX)
|
||||
- **Contradictions/Notes:** PageSpeed Insights는 웹 성능을 평가하는 공식적이고 강력한 도구이지만, LCP 하위 요소 데이터와 같은 특정 세부 지표는 도구 내에서 직접 확인할 수 없어 다른 시각화 도구의 병행 사용이 필요할 수 있습니다 [5].
|
||||
### 매 Core Web Vitals (2026)
|
||||
- **LCP (Largest Contentful Paint)**: largest visible element render. Good ≤ 2.5s.
|
||||
- **INP (Interaction to Next Paint)**: 75th percentile interaction responsiveness. Good ≤ 200ms. (replaced FID in 2024)
|
||||
- **CLS (Cumulative Layout Shift)**: visual stability score. Good ≤ 0.1.
|
||||
|
||||
---
|
||||
*Last updated: 2026-04-19*
|
||||
### 매 Lighthouse score weighting (v11+)
|
||||
- FCP 10%, LCP 25%, TBT 30%, CLS 25%, SI 10%.
|
||||
- Score: 0-100 — 매 90+ green, 50-89 orange, <50 red.
|
||||
|
||||
---
|
||||
### 매 응용
|
||||
1. SEO optimization (CWV signal in Google ranking).
|
||||
2. Conversion rate (faster site → 매 7% lift per 100ms).
|
||||
3. CI/CD performance budgets.
|
||||
4. Marketing site audits.
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
## 💻 패턴
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
|
||||
## 💻 코드 패턴 (Code Patterns)
|
||||
|
||||
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
|
||||
|
||||
```text
|
||||
# TODO
|
||||
### CLI Lighthouse audit
|
||||
```bash
|
||||
npm install -g lighthouse
|
||||
lighthouse https://example.com --output=html --output-path=./report.html \
|
||||
--preset=desktop --chrome-flags="--headless"
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### PageSpeed Insights API
|
||||
```javascript
|
||||
const KEY = process.env.PSI_API_KEY;
|
||||
const url = 'https://example.com';
|
||||
const r = await fetch(
|
||||
`https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=${url}&key=${KEY}&strategy=mobile&category=performance`
|
||||
);
|
||||
const data = await r.json();
|
||||
console.log('LCP:', data.lighthouseResult.audits['largest-contentful-paint'].displayValue);
|
||||
console.log('INP (field):', data.loadingExperience.metrics.INTERACTION_TO_NEXT_PAINT?.percentile);
|
||||
```
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### web-vitals (real user monitoring)
|
||||
```javascript
|
||||
import { onLCP, onINP, onCLS } from 'web-vitals';
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
function send(metric) {
|
||||
navigator.sendBeacon('/analytics', JSON.stringify(metric));
|
||||
}
|
||||
onLCP(send);
|
||||
onINP(send); // replaces onFID in v4+
|
||||
onCLS(send);
|
||||
```
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
### Optimize LCP
|
||||
```html
|
||||
<!-- Preload hero image -->
|
||||
<link rel="preload" as="image" href="/hero.webp" fetchpriority="high">
|
||||
<img src="/hero.webp" fetchpriority="high" loading="eager" decoding="async">
|
||||
```
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
### Optimize INP
|
||||
```javascript
|
||||
// Break long tasks with scheduler.yield() (2026 baseline)
|
||||
async function processItems(items) {
|
||||
for (const item of items) {
|
||||
process(item);
|
||||
if (navigator.scheduling?.isInputPending()) {
|
||||
await scheduler.yield();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
### Optimize CLS
|
||||
```css
|
||||
/* Reserve space for images */
|
||||
img { aspect-ratio: 16/9; width: 100%; height: auto; }
|
||||
|
||||
/* Avoid late-injected content shifting layout */
|
||||
.ad-slot { min-height: 250px; }
|
||||
```
|
||||
|
||||
### CI performance budget (Lighthouse CI)
|
||||
```yaml
|
||||
# lighthouserc.yml
|
||||
ci:
|
||||
collect:
|
||||
url: ['http://localhost:3000']
|
||||
numberOfRuns: 3
|
||||
assert:
|
||||
assertions:
|
||||
'categories:performance': ['error', { minScore: 0.9 }]
|
||||
'largest-contentful-paint': ['error', { maxNumericValue: 2500 }]
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Dev iteration | Lighthouse lab (Chrome DevTools) |
|
||||
| Production health | CrUX field data (PSI API) |
|
||||
| Regression detection | Lighthouse CI in pipeline |
|
||||
| Real user monitoring | web-vitals library + analytics |
|
||||
| SEO impact | CrUX 28-day field — Google's actual signal |
|
||||
|
||||
**기본값**: Lighthouse CI for regression + web-vitals RUM for production reality.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Web-Performance]] · [[Core-Web-Vitals]]
|
||||
- 변형: [[Lighthouse]] · [[CrUX]] · [[WebPageTest]]
|
||||
- 응용: [[SEO]] · [[Performance-Budgets]] · [[RUM]]
|
||||
- Adjacent: [[CDN]] · [[Image-Optimization]] · [[Code-Splitting]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: 매 web app perf optimization, SEO improvement, CI regression catching.
|
||||
**언제 X**: 매 native mobile app, backend API perf (use APM tools instead).
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Lab-only optimization**: 매 99 score in lab, terrible field data — 매 real users 가 다른 hardware/network.
|
||||
- **Ignoring INP**: 매 still tracking only FID — 매 deprecated in 2024.
|
||||
- **Score fixation**: 매 chasing 100 score 가 user-visible improvement 없음.
|
||||
- **Mobile ignored**: 매 PSI mobile-first, 매 mobile score < desktop typically.
|
||||
- **No field data check**: 매 lab green, CrUX red — 매 real users hurt.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Google PSI docs, web.dev/vitals, Chrome DevRel).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — INP-aware, CWV optimization patterns |
|
||||
|
||||
Reference in New Issue
Block a user