本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)75k · #3037

streaming-html

できること

このスキルは、サーバーの描画のコードを確認し、HTMLがストリーミングされているか、すべての準備が整うまで保留されているかを確かめます。必要な場合にはストリーミングを提案します。Next.jsやNode.jsのアプリなど、サーバーで描画されるサイトの開発者向けです。

使う場面

  • ✓サーバーで描画されたページがHTMLをストリーミングしているか確認するようエージェントに頼むとき。
  • ✓遅い1つのデータ取得がすべてを止めているため、最初のバイトまでに長い時間がかかるとき。
  • ✓Next.js App RouterやNode.jsのハンドラーを使い、ストリーミングが正しく設定されているか確認したいとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/streaming-html/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“遅い1つのクエリがすべてを止めているため、私のサーバー描画のページは何かが表示されるまで長く時間がかかります。ストリーミングを設定してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、描画のコードがHTMLを送る前にすべてのデータを待っているかを確認します。次に、遅いデータの周りにSuspenseの境界を追加するか、ストリーミングのAPIを使い、ページの上部をすぐに送ります。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Stream HTML to the browser before the full response is ready

Traditional SSR waits for all data fetches to complete before sending a single byte of HTML, which means the browser cannot parse, discover subresources, or render anything until the slowest data query finishes. Streaming decouples the delivery of above-fold content from slow database queries and third-party API calls, dramatically improving perceived performance and LCP.

Quick Reference

  • Streaming sends HTML in chunks as it is generated instead of waiting for the full response
  • React renderToPipeableStream and Next.js App Router stream by default when you use Suspense
  • Place Suspense boundaries around slow data dependencies to flush above-fold HTML immediately
  • Monitor TTFB in Lighthouse — values above 600ms are a sign that streaming is not being used

Check

Examine this server-side rendering implementation to determine whether HTML is streamed in chunks or buffered until fully generated before sending to the client.

Fix

Refactor the SSR implementation to use renderToPipeableStream with Suspense boundaries around slow data fetches, or use ReadableStream in a Node.js handler, so that above-fold HTML is flushed to the client immediately.

Explain

Explain how streaming HTML improves TTFB and FCP by decoupling the delivery of fast content from slow server-side data dependencies.

Code Review

Review server entry points and page components for renderToString calls, missing Suspense boundaries around data-fetching components, and use of await on slow queries before returning a response.


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

Rule page: https://frontendchecklist.io/rules/performance/streaming-html

よくある質問

ストリーミングは訪問者にとって何を変えますか?

このスキルによると、ブラウザーは最も遅いデータのクエリが終わる前に、解析、リソースの検出、コンテンツの表示ができます。

Next.jsではストリーミングは自動ですか?

このスキルによると、Suspenseを使うと、App Routerは既定でストリーミングします。

どの数値を見るべきですか?

このスキルは、LighthouseでTime to First Byteを見ることを勧めており、600ミリ秒を超える値はストリーミングが不足している兆候だとしています。

詳細

作者による元の説明

Use when reviewing server-side rendering setup, Next.js App Router pages, or Node.js HTTP handlers to verify that HTML is streamed incrementally rather than buffered until completion.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#3037
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル