Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/dipro-vn/dipro-ai-boost --skill nextjs-data-fetchingコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
SKILL.md を表示中
| name | nextjs-data-fetching |
| description | null |
Category: nextjs · Status: 🟢 Active
Khi fetch data phía server trong App Router với kiểm soát cache/revalidate.
fetch(url, { cache: 'force-cache' | 'no-store' }).next: { revalidate: 60 } để làm mới định kỳ.Promise.all để tránh waterfall.<Suspense> + loading để stream phần chậm, không block cả trang.export default async function Page() {
const [user, posts] = await Promise.all([
fetch(`${API}/user`, { next: { revalidate: 60 } }).then((r) => r.json()),
fetch(`${API}/posts`, { cache: 'no-store' }).then((r) => r.json()),
]);
return <Dashboard user={user} posts={posts} />;
}
Good: Promise.all song song, revalidate hợp lý, no-store cho data động. Avoid: await tuần tự gây waterfall, fetch ở client khi server làm được.
SOC 職業分類に基づく